R EPRESENTATIONAL C ONTINUITY FOR U NSUPERVISED C ONTINUAL L EARNING
A BSTRACT
Continual learning (CL) aims to learn a sequence of tasks without forgetting the previously acquired knowledge.
However, recent CL advances are restricted to supervised continual learning (SCL) scenarios.
Consequently, they are not scalable to real-world applications where the data distribution is often biased and unannotated.
In this work, we focus on unsupervised continual learning (UCL) , where we learn the feature representations on an unlabelled sequence of tasks and show that reliance on annotated data is not necessary for continual learning.
We conduct a systematic study analyzing the learned feature representations and show that unsupervised visual representations are surprisingly more robust to catastrophic forgetting, consistently achieve better performance, and generalize better to out-ofdistribution tasks than SCL.
Furthermore, we ﬁnd that UCL achieves a smoother loss landscape through qualitative analysis of the learned representations and learns meaningful feature representations.
Additionally, we propose L ifelong
U nsupervised M ixu p (L UMP ), a simple yet effective technique that interpolates between the current task and previous tasks’ instances to alleviate catastrophic forgetting for unsupervised representations.
We release our code online.
I NTRODUCTION
Recently continual learning (Thrun, 1995) has gained a lot of attention in the deep learning community due to its ability to continually learn on a sequence of non-stationary tasks (Kumar & Daume III, 2012; Li & Hoiem, 2016) and close proximity to the human learning process (Flesch et al., 2018).
However, the inability of the learner to prevent forgetting of the knowledge learnt from the previous tasks has been a long-standing problem (McCloskey & Cohen, 1989; Goodfellow et al., 2013).
To address this problem, a large body of methods (Rusu et al., 2016; Zenke et al., 2017; Yoon et al., [-
-]2018;
Li et al., 2019; Aljundi et al., 2019; Buzzega et al., 2020) have been proposed; however, all these methods focus on the supervised learning paradigm, but obtaining high-quality labels is expensive and often impractical in real-world scenarios.
In contrast, CL for unsupervised representation learning has received limited attention in the community.
Although Rao et al.
(2019) instantiated a continual unsupervised representation learning framework (C URL ), it is not scalable for high-resolution tasks, as it is composed of MLP encoders/decoders and a simple MoG generative replay.
This is evident in their limited empirical evaluation using digit-based gray-scale datasets.
Meanwhile, a set of directions have shown huge potential to tackle the representation learning problem without labels (He et al., 2020;
Chen et al., 2020a; Grill et al., 2020;
Chen et al., 2020b; Chen &
He, 2021; Zbontar et al., 2021) by aligning contrastive pairs of training instances or maximizing the similarity between two augmented views of each image.
However, a common assumption for existing methods is the availability of a large amount of unbiased and unlabelled datasets to learn the feature representations.
We argue that this assumption is not realistic for most of the real-time applications, including self-driving cars (Bojarski et al., 2016), medical applications (Kelly et al., 2019) and conversational agents (Li et al., 2020).
The collected datasets are often limited in size during the initial training phase (Finn et al., 2017), and datasets/tasks change continuously with time.
[Figure]
𝑳𝑳 𝑵 𝓓 𝝉 : → 𝒴 𝒌,𝝉 ( , 𝒴 𝒌,𝝉 ) 𝒉 𝝍 𝟏 ( , 𝒴 𝒋,𝟏 ) 𝓤 𝟏 :
→ 𝒴 𝒋, … 𝑳𝑳 𝑵 … 𝑳𝑳 𝑵
Correlation loss … 𝓤 𝝉
View
View
[Figure]
Revisit genericfeatures
[Figure]
Learned Representation
[Figure]
To accommodate such continuous shifts in data distributions, representation learning models need to increment the knowledge without losing the representations learned in the past.
With this motivation, we attempt to bridge the gap between unsupervised representation learning and continual learning to address the challenge of learning the representations on a sequence of tasks.
Speciﬁcally, we focus on unsupervised continual learning (UCL) , where the goal of the continual learner is to learn the representations from a stream of unlabelled data instances without forgetting (see Figure 1).
To this end, we extend various existing SCL strategies to the unsupervised continual learning framework and analyze the performance of current state-of-the-art representation learning techniques:
SimSiam (Chen & He, 2021) and BarlowTwins (Zbontar et al., 2021) for UCL.
Surprisingly, we observe that the unsupervised representations are comparatively more robust to catastrophic forgetting across all datasets and simply ﬁnetuning on the sequence of tasks can outperform various state-of-the-art continual learning alternatives.
Furthermore, we show that UCL generalize better to various out of distribution tasks and outperforms SCL for few-shot training scenarios (Section 5.2).
We demystify the robustness of unsupervised representations by investigating the feature similarity, measured by centered kernel alignment (CKA)
(Kornblith et al., 2019) between two independent UCL and SCL models and between UCL and SCL models.
We notice that two unsupervised model representations have a relatively high feature similarity compared to two supervised representations.
Furthermore, in all cases, two models have high similarity in lower layers indicating that they learn similar low-level features.
Further, we measure the ‘ 2 distance between model parameters (Neyshabur et al., 2020) and visually compare the feature representations learned by different SCL and UCL strategies.
We observe that UCL obtains human perceptual feature patterns for previous tasks, demonstrating their effectiveness to alleviate catastrophic forgetting (Section 5.3).
We conjecture that this is due to their characteristic ability to learn general-purpose features (Doersch et al., 2020), which makes them transfer better and comparatively more robust to catastrophic forgetting.
To gain further insights, we visualize the loss landscape (Li et al., 2018) of the UCL and SCL models and observe that UCL obtains a ﬂatter and smoother loss landscape than SCL.
Additionally, we propose a simple yet effective technique coined L ifelong U nsupervised M ixu p (L UMP ), which utilizes mixup (Zhang et al., 2018) for unlabelled training instances.
In particular, L UMP interpolates between the current task examples and examples from previous instances to minimize catastrophic forgetting.
We emphasize that L UMP is easy to implement, does not require additional hyperparameters, and simply trains on the interpolated instances.
To this end, L UMP requires little, or no modiﬁcation to existing rehearsal-based methods effectively minimizes catastrophic forgetting even with uniformly selecting the examples from replay buffer.
We show that L UMP with UCL outperforms the state-ofthe-art supervised continual learning methods across multiple experimental settings with signiﬁcantly lower catastrophic forgetting.
In summary, our contributions are as follows:
• We attempt to bridge the gap between continual learning and representation learning and tackle the two crucial problems of continual learning with unlabelled data and representation learning on a sequence of tasks.
• Systematic quantitative analysis shows that UCL achieves better performance over SCL with signiﬁcantly lower catastrophic forgetting on Sequential CIFAR-10, CIFAR-100, and Tiny-ImageNet.
Additionally, we evaluate out-of-distribution tasks and few-shot training demonstrating the expressive power of unsupervised representations.
• We provide visualization of the representations and loss landscapes, which show that UCL learns discriminative, human perceptual patterns and achieves a ﬂatter and smoother loss landscape.
Furthermore, we propose L ifelong U nsupervised M ixu p (L UMP ) for UCL, which effectively alleviates catastrophic forgetting and provides better qualitative interpretations.
R ELATED WORK
Continual learning.
We can partition the existing continual learning methods into three categories.
The regularization approaches (Li & Hoiem, 2016; Zenke et al., 2017; Schwarz et al., 2018; Ahn et al., 2019) impose a regularization constraint to the objective that mitigates catastrophic forgetting.
The architectural approaches (Rusu et al., 2016; Li et al., 2019; Yoon et al., 2020) avoid this problem by including task-speciﬁc parameters and allowing the expansion of the network during continual learning.
The rehearsal approaches (Rebufﬁ et al., 2017; Rolnick et al., 2019; Aljundi et al., 2019) allocate a small memory buffer to store and replay the examples from the previous task.
However, all these methods are conﬁned to supervised learning, which limits their application in real-life problems.
Rao et al.
(2019) tackled the problem of continual unsupervised representation learning and learned task-speciﬁc representations on shared parameters; however, their method is restricted to simple low-resolution tasks and not scalable to standard CL benchmark datasets.
Representational learning.
A large number of works have addressed the unsupervised learning problem in the standard machine learning framework.
Speciﬁcally, contrastive learning frameworks (He et al., 2020; Chen et al., 2020a;
Grill et al., 2020; Chen et al., 2020b;c) that learn the representations by measuring the similarities of positive and negative pairs have gained a lot of attention in the community.
However, all these methods require large batches and negative sample pairs, which restrict the scalability of these networks.
Chen & He (2021) tackled these limitations and proposed SimSiam , that use standard Siamese networks (Bromley et al., 1994) with the stop-gradient operation to prevent the collapsing of Siamese networks to a constant.
Recently, Zbontar et al.
(2021) formulated an objective that pushes the cross-correlation matrix between the embeddings of distorted versions of a sample closer to the identity matrix.
However, all these methods assume the presence of large datasets for pre-training, which is impractical in real-world applications.
In contrast, we tackle the problem of incremental representational learning and learn the representations sequentially while maximizing task adaptation and minimizing catastrophic forgetting.
P RELIMINARIES 3. P ROBLEM S ETUP
We consider the continual learning setting, where we learn on a continuum of data consisting of
T tasks T 1: T =
( T 1 : : : T T ) .
In supervised continual learning, each task consists a task descriptor (cid:28) 2 f 1 : : : T g and its corresponding dataset D (cid:28) = f
( x i;(cid:28) ; y i;(cid:28) ) n (cid:28) i =1 g with n (cid:28) examples.
Each inputpair ( x i;(cid:28) ; y i;(cid:28) )
2 X (cid:28) (cid:2) Y (cid:28) , where ( X (cid:28) ; Y (cid:28) ) is an unkown data distribution. Let us consider a network f (cid:2) : X (cid:28) ! R D parametrized by (cid:2) =
f w l g l = L l =1 , where R D and L denote D -dimensional embedding space and number of layers respectively.
The classiﬁer is denoted by h : R D !
Y (cid:28) .
The network error using cross entropy loss (CE) for SCL with ﬁnetuning can be formally deﬁned as:
[Equation]
In this work, we assume the absence of label supervision during training and focus on unsupervised continual learning.
In particular, each task consists of U (cid:28) =
f
( x i;(cid:28) ) n (cid:28) i =1 g , x i;(cid:28) 2 X (cid:28) with n (cid:28) examples.
Our aim is to learn the representations f (cid:2) : X (cid:28) ! R D on a sequence of tasks while preserving the knowledge of the previous tasks.
We introduce the representation learning framework and propose L UMP in Section 4 to learn unsupervised representations while effectively mitigating catastrophic forgetting.
3. L EARNING P ROTOCOL AND E VALUATION M ETRICS
Currently, the traditional continual learning strategies follow the standard training protocol, where we learn the network representations f (cid:2) : X (cid:28) !
Y (cid:28) on a sequence of tasks.
In contrast, our goal is to learn the feature representations f (cid:2) : X (cid:28) ! R D , so we follow a two-step learning protocol to obtain the model predictions.
First, we pre-train the representations on a sequence of tasks
T 1: T =
( T : : : T T ) to obtain the representations.
Next, we evaluate the quality of our pre-trained representations using a K-nearest neighbor (KNN) classiﬁer (Wu et al., 2018) following the setup in Chen et al.
(2020a)
; Chen & He (2021); Zbontar et al.
To validate knowledge transfer of the learned representations, we adopt the metrics from the SCL literature (Chaudhry et al., 2019b; Mirzadeh et al., 2020).
Let a (cid:28);i denote the test accuracy of task i after learning task T (cid:28) using a KNN on frozen pre-trained representations on task T (cid:28) .
More formally, we can deﬁne the metrics to evaluate the continually learned representations as follow:
Average accuracy is the average test accuracy of all the tasks completed until the continual learning of task (cid:28) : A (cid:28) = 1 (cid:28) P (cid:28)i =1 a (cid:28);i 2.
Average Forgetting is the average performance decrease of each task between its maximum accuracy and accuracy at the completion of training: F =
[Table]
U NSUPERVISED C ONTINUAL L EARNING 4. C ONTINUOUS REPRESENTATION LEARNING WITH SEQUENTIAL TASKS
To learn feature representations, contrastive learning (Chen et al., 2020a;b; He et al., 2020) maximizes the similarity of representations between the images of the same views (positive pairs) and minimizes the similarity between images of different views (negative pairs).
However, these methods require large batches, negative sample pairs (Chen et al., 2020a;b), or architectural modiﬁcations (He et al., 2020; Chen et al., 2020c), or non-differentiable operators (Caron et al., 2020), which makes their application difﬁcult for continual learning scenarios.
In this work, we focus on SimSiam (Chen & He, 2021) and BarlowTwins (Zbontar et al., 2021), which tackle these limitations and achieve state-of-the-art performance on standard representation learning benchmarks.
SimSiam (Chen & He, 2021) uses a variant of Siamese networks (Bromley et al., 1994) for learning input data representations.
It consists of an encoder network f (cid:2) , which is composed of a backbone network, and is shared across a projection MLP and prediction MLP head h ( (cid:1) ) .
Speciﬁcally, SimSiam minimizes the cosine-similarity between the output vectors of the projector and the predictor MLP across two different augmentations for an image.
Initially, we consider F INETUNE , which is a a naive
CL baseline that minimizes the cosine-similarity between the projector output ( z 1 i;(cid:28) = f (cid:2) ( x 1 i;(cid:28) )) and the predictor output ( p 2 i;(cid:28) =
h ( f (cid:2) ( x 2 i;(cid:28) )) on a sequence of tasks as follows:
[Equation]
where D ( p 1 i;(cid:28) ; z 2 i;(cid:28) )
= (cid:0) p 1 i;(cid:28) k p 2 i;(cid:28) k 2 (cid:1) z 2 i;(cid:28) k
[Equation]
2 i;(cid:28) k
[Equation] x 1 i;(cid:28) and x 2 i;(cid:28) are two randomly augmented views of an input example x i;(cid:28) 2 T (cid:28) and k(cid:1)k 2 denotes the ‘ 2 -norm.
Note that, the stopgrad is a crucial component in SimSiam to prevent the trivial solutions obtained by Siamese networks.
Due to its simplicity and effectiveness, we chose Simsiam to analyze the performance of unsupervised representations for continual learning.
BarlowTwins (Zbontar et al., 2021) minimizes the redundancy between the embedding vector components of the distorted versions of an instance while conserving the maximum information inspired from Barlow (1961).
In particular, the objective function eliminates the SimSiam stopgrad component and instead makes the cross-correlation matrix computed between the outputs of two identical networks closer to the identity matrix.
Let C be the cross-correlation matrix between the outputs of two Siamese branches along the batch dimension and Z 1 and Z 2 denote the batch embeddings of the distorted views for all images of a batch from the current task ( x (cid:28) 2 U (cid:28) ) .
The objective function for UCL with ﬁnetuning and BarlowTwins can then be deﬁned as:
[Equation]
; where [Equation] (cid:21) is a positive constant trading off the importance of the invariance and redundancy reduction terms of the loss, i and j denote the network’s output vector dimensions.
Similar to SimSiam, BarlowTwins is simple, easy to implement, and can be applied to existing continual learning strategies with little or no modiﬁcation.
4. P RESERVING REPRESENTATIONAL CONTINUITY : A VIEW OF EXISTING SCL METHODS
Learning feature representations from labelled instances on a sequence of tasks has been long studied in continual learning.
However, the majority of these learning strategies are not directly applicable to UCL.
To compare with the regularization-based strategies, we extend Synaptic Intelligence (SI) (Zenke et al., 2017) to UCL and consider the online per-synapse consolidation during the entire training trajectory of the unsupervised representations.
For architectural-based strategies, we investigate Progressive Neural Networks (PNN) (Rusu et al., 2016) and learn the feature representations progressively using the representations learning frameworks proposed in Section 4.1.
We also formulate Dark Experience Replay (DER)
(Buzzega et al., 2020) for UCL.
DER for SCL alleviates catastrophic forgetting by matching the network logits across a sequence of tasks during the optimization trajectory.
Notably, the loss for SCL-DER can be deﬁned as follow:
[Equation]
[Equation] where p = h (cid:30) (cid:28) ( x ) , L F INETUNE SCL denotes the cross-entropy loss on the current task (see Equation (1)) and random examples are selected using reservoir sampling from the replay-buffer M .
Since, we do not have access to the labels for UCL, we cannot minimize the aforementioned objective.
Instead, we utilize the output of the projected output by the backbone network to preserve the knowledge of the past tasks over the entire training trajectory.
In particular, DER for UCL consists of a combination of two terms.
The ﬁrst term learns the representations using SimSiam from Equation (2) or BarlowTwins from Equation (3) and the second term minimizes the Euclidean distance between the projected outputs to minimize catastrophic forgetting.
More formally, UCL-DER minimizes the following loss
[Equation]
However, the performance of the rehearsal-based methods is sensitive to the choice of (cid:11) and often requires supervised training setup, task identities, and boundaries.
To tackle this issue, we propose
Lifelong Unsupervised Mixup in the subsequent subsection, which interpolates between the current and past task instances to mitigate catastrophic forgetting effectively.
4. L IFELONG UNSUPERVISED MIXUP
The standard Mixup (Zhang et al., 2018) training constructs virtual training examples based on the principle of Vicinal Risk Minimization .
In particular, let ( x i ; y i ) and ( x j ; y j ) denote two random feature-target pairs sampled from the training data distribution and let (~ x; ~ y ) denote the interpolated feature-target pair in the vicinity of these examples; mixup minimizes the following objective on the interpolated samples:
[Equation]
6) where ~ x = (cid:21)
[Equation]
[Equation]
x j and ~ y = (cid:21) (cid:1) [Equation] + ( [Equation]
(cid:0) (cid:21) ) [Equation] (cid:21) (cid:24) Beta ( (cid:11); (cid:11) ) , for (cid:11) 2 (0 ; 1 ) .
In this work, we propose Lifelong Unsupervised Mixup (L UMP ) that utilizes mixup for unsupervised continual learning by incorporating the instances stored in the replay-buffer from the previous tasks into the vicinal distribution.
In particular, L UMP interpolates between the examples of the current task ( x i;
[Equation]
) 2 U (cid:28) and random examples selected using uniform sampling from the replay buffer, which encourages the model to behave linearly across a sequence of tasks.
More formally, L UMP minimizes the objective in Equation (2) and Equation (3) on the following interpolated instances ~ x i;(cid:28) for the current task (cid:28) :
[Equation]
where x j; M (cid:24) M denotes the example selected using uniform sampling from replay buffer M .
The interpolated examples not only augments the past tasks’ instances in the replay buffer but also approximates a regularized loss minimization (Zhang et al., 2021).
During UCL, L UMP enhances the robustness of learned representation by revisiting the attributes of the past task that are similar to the current task.
To this end, L UMP successively mitigates catastrophic forgetting and learns discriminative & human-perceptual features with signiﬁcant improvement in performance over the current state-of-the-art SCL strategies (see Table 1 and Figure 4).
Furthermore, unlike the existing rehearsal-based methods, it does not require the tuning of additional hyper-parameters.
E XPERIMENTS 5. E XPERIMENTAL SETUP
Baselines.
We compare with multiple supervised and unsupervised continual learning baselines across different categories of continual learning methods.
Supervised continual learning.
F INETUNE is a vanilla supervised learning method trained on a sequence of tasks without regularization or episodic memory and M ULTITASK optimizes the model on complete data.
For regularization-based CL methods, we compare against SI (Zenke et al., 2017) and AGEM (Chaudhry et al., 2019a).
We include PNN (Rusu et al., 2016) for architecture-based methods.
Lastly, we consider GSS (Aljundi et al., 2019) that populates the replay-buffer using solid-angle minimization and DER (Buzzega et al., 2020) matches the network logits sampled through the optimization trajectory for rehearsal during continual learning.
Unsupervised continual learning.
We consider the unsupervised variants of various SCL baselines to show the utility of the unsupervised representations for sequential learning.
Speciﬁcally, we use S IM S IAM (Chen & He, 2021) and B ARLOW T WINS (Zbontar et al., 2021), which are the state-of-the-art representational learning techniques for learning the unsupervised continual representations.
We compare with F INETUNE and M ULTITASK following the supervised learning baselines, and S I
(Zenke et al., 2017), P NN
(Rusu et al., 2016) for unsupervised regularization and architecture CL methods respectively.
For rehearsal-based method, we compare with the UCL variant of D ER (Buzzega et al., 2020) described in Section 4.
Datasets.
We compare the performance of SCL and UCL on various continual learning benchmarks using single-head ResNet-18 ( He et al., 2016) architecture.
Split CIFAR-10 (Krizhevsky, 2012) consists of two random classes out of the ten classes for each task.
Split CIFAR-100 (Krizhevsky, 2012) consists of ﬁve random classes out of the 100 classes for each task.
Split Tiny-ImageNet is a variant of the ImageNet dataset (Deng et al., 2009) containing ﬁve random classes out of theclasses for each task with the images sized 64 (cid:2) 64 pixels.
Training and evaluation setup.
We follow the hyperparameter setup of Buzzega et al.
(2020) for all the SCL strategies and tune them for the UCL representation learning strategies.
All the learned representations are evaluated with KNN classiﬁer (Wu et al., 2018) across three independent runs.
Further, we use the hyper-parameters obtained by SimSiam for training UCL strategies with
BarlowTwins to analyze the sensitivity of UCL to hyper-parameters and for a fair comparison between different methods.
We train all the UCL methods for 200 epochs and evaluate with the KNN classiﬁer (Wu et al., 2018).
We provide the hyper-parameters in detail in Table A.5.
5. Q UANTITATIVE RESULTS
Evaluation on SimSiam.
Table 1 shows the evaluation results for supervised and unsupervised representations learnt by SimSiam (Chen & He, 2021) across various continual learning strategies.
In all cases, continual learning with unsupervised representations achieves signiﬁcantly better performance than supervised representations with substantially lower forgetting.
For instance, S I with UCL obtains better performance and 68% , 54% , and 44% lower forgetting relative to the best-performing SCL strategy on Split CIFAR-10, Split CIFAR-100, and Split Tiny-ImageNet, respectively.
Surprisingly,
F INETUNE with UCL achieves higher performance and signiﬁcantly lower forgetting in comparison to all SCL strategies except D ER .
Furthermore, L UMP improves upon the UCL strategies: 2 : 8% and 5 : 9% relative increase in accuracy and 15% and 57 : 1% relative decrease in forgetting on Split
CIFAR-100 and Split Tiny-ImageNet, respectively.
Evaluation on BarlowTwins.
To verify that unsupervised representations are indeed more robust to catastrophic forgetting, we train BarlowTwins (Zbontar et al., 2021) on a sequence of tasks.
We notice that the representations learned with BarlowTwins substantially improve the accuracy and forgetting over SCL: 71 : 4% , 69 : 7% and 73 : 2% decrease in forgetting with F INETUNE on Split CIFAR-10, Split
CIFAR-100 and Split Tiny-ImageNet respectively.
Similarly, we observe that S I , and D ER are more robust to catastrophic forgetting; however, PNN underperforms on complicated tasks since feature accumulation using adaptor modules is insufﬁcient to construct useful representations for current task adaptation.
Interestingly, representations learnt with BarlowTwins achieve lower forgetting for
F INETUNE , D ER and L UMP than SimSiam with comparable accuracy across all the datasets.
[Table]
et al.,
[Figure]
[Figure]
[Figure]
Evaluation on Few-shot training.
Figure 2 compares the effect of few-shot training on UCL and
SCL, where each task has a limited number of training instances.
Speciﬁcally, we conduct the experimental evaluation using 100 , 200 , 500 , and 2500 training instances for each task in split
CIFAR-100 dataset.
Surprisingly, we observe that the gap in average accuracy between SCL and
UCL methods widens with a decrease in the number of training instances.
Note that UCL decreases the accuracy by 15 : 78% p on average with lower forgetting when the number of training instances decreases from 2500 to 100 ; whereas, SCL obtains a severe 32 : 21% p deterioration in accuracy.
We conjecture that this is an outcome of the discriminative feature embeddings learned by UCL, which discriminates all the images in the dataset and captures more than class-speciﬁc information as also observed in Doersch et al.
Furthermore, L UMP improves the performance over all the baselines with a signiﬁcant margin across all few-shot experiments.
Evaluation on OOD datasets.
We evaluate the learnt representations on various out-of-distribution (OOD) datasets in Table 2 to measure their generalization to unseen data distributions.
In particular, we conduct the OOD evaluation on MNIST (LeCun, 1998), Fashion-MNIST (FMNIST) (Xiao et al., 2017), SVHN (Netzer et al., 2011), CIFAR-10 and CIFAR-100 (Krizhevsky, 2012) using a KNN classiﬁer (Wu et al., 2018).
We observe that unsupervised representations outperform the supervised representations in all cases across all the datasets.
In particular, the UCL representations learned with
Simsiam, and S I on Split-CIFAR-10 improves the absolute performance over the best-performing
SCL strategy by 4.58%, 6.09%, 15.26%, and 17.07% on MNIST, FMNIST, SVHN, and CIFARrespectively.
Further, L UMP trained on Split-CIFAR-100 outperforms S I across all datasets and obtains comparable performance with Split CIFAR-10 dataset.
[Table]
M ULTITASK
[Table]
[Table]
5. Q UALITATIVE ANALYSIS
Similarity in feature and parameter space.
We analyze the similarity between the representations learnt between (i) Two independent UCL models, (ii) Two independent SCL models (iii) SCL and UCL models using centered kernel alignment (CKA)
(Kornblith et al., 2019) in Figure 3, which provides a score between 0 and 1 measuring the similarity between a pair of hidden representations.
For two representations (cid:2) 1 : X ! R d 1 and (cid:2) 2 : X ! R d 1 , CKA ((cid:2) 1 ; (cid:2) 2 ) =
[Table]
where covariances are with respect to the test distribution.
Additionally, we measure the ‘ 2 distance (Neyshabur et al., 2020) between the parameters of two independent UCL models (see Table 3) and two independent SCL models (see Table 4).
First, we observe that the representations learned by two independent UCL methods have a high feature similarity and lower ‘ 2 distance compared to the two independent SCL methods, demonstrating UCL representations’ robustness.
Second, we note that the representations between any two independent models are highly similar in the lower layers indicating that they learn similar high-level features, including edges and shapes; however, the features are dissimilar for the higher modules.
Lastly, we see that the representations between a UCL and SCL model are similar in the lower layers but diverge in the higher layers across all CL strategies.
Visualization of feature space.
Next, we visualize the learned features to dissect further the representations learned by UCL and SCL strategies.
Figure 4 shows the visualization of the latent feature maps for tasks T 0 and T 13 after the completion of continual learning.
For T 0 , we observe that the SCL methods are prone to catastrophic forgetting, as the features appear noisy and do not have coherent patterns.
In contrast, the features learned by UCL strategies are perceptually relevant and robust to catastrophic forgetting, with L UMP learning the most distinctive features.
Similar to T 0 , we observe that the UCL features are more relevant and distinguishable than SCL for T 13 .
Note that we randomly selected the examples and feature maps for all visualizations.
Loss landscape visualization.
To gain further insights, we visualize the loss landscape of task Tafter the completion of training on task T 0 and T 19 for various UCL and SCL strategies in Figure 5.
We measure the cross-entropy loss for all methods with a randomly initialized linear classiﬁer for a fair evaluation of two different directions.
We use the visualization tool from Li et al.
(2018) that searches the task loss surface by repeatedly adding random perturbations to model weights.
We observe that the loss landscape after T 0 looks quite similar across all the strategies since the forgetting does not exist yet.
However, after training T 19 , there is a clear difference with the UCL strategies obtaining a ﬂatter and smoother loss landscape because UCL methods are more stable and robust to the forgetting, which hurts the loss landscapes of past tasks for SCL.
It is important to observe that
L UMP obtains a smoother landscape than other UCL strategies, demonstrating its effectiveness.
We defer further analyses for feature and loss landscape visualization to Appendix A.2.
[Table] [Table]
[Figure] [Figure]
D ISCUSSION AND C ONCLUSION
This work attempts to bridge the gap between unsupervised representation learning and continual learning.
In particular, we establish the following ﬁndings for unsupervised continual learning.
Surpassing supervised continual learning.
Our empirical evaluation across various CL strategies and datasets shows that UCL representations are more robust to catastrophic forgetting than SCL representations.
Furthermore, we notice that UCL generalizes better to OOD tasks and achieves stronger performance on few-shot learning tasks.
We propose Lifelong unsupervised mixup ( L UMP ) , which interpolates the unsupervised instances between the current task and past task and obtains higher performance with lower catastrophic forgetting across a wide range of tasks.
Dissecting the learned representations.
We conduct a systematic analysis to understand the differences between the representations learned by UCL and SCL strategies.
By investigating the similarity between the representations, we observe that UCL and SCL strategies have high similarities in the lower layers but are dissimilar in the higher layers.
We also show that UCL representations learn coherent and discriminative patterns and smoother loss landscape than SCL.
Limitations and future work.
In this work, we do not consider the high-resolution tasks for CL.
We intend to evaluate the forgetting of the learnt representations on ImageNet (Deng et al., 2009) in future work, since UCL shows lower catastrophic forgetting and representation learning has made signiﬁcant progress on ImageNet over the past years.
In follow-up work, we intend to conduct further analysis to understand the behavior of UCL and develop sophisticated methods to continually learn unsupervised representations under various setups, such as class-incremental or task-agnostic CL.
A UTHOR C ONTRIBUTIONS
Divyam Madaan conceived of the presented idea, developed the experimental framework, planned the experiments, carried out OOD evaluation, CKA visualization and took the lead in writing the manuscript. Jaehong Yoon performed the hyperparameter search, carried out the visualization of loss landscape and feature maps and performed the few-shot training analysis.
Yuanchun Li, Yunxin Liu, and Sung Ju Hwang supervised the project.
A S UPPLEMENTARY M ATERIAL
Organization.
In the supplementary material, we provide the implementation details followed by the hyper-parameter conﬁgurations in Appendix A.1.
Further, we show the other experiments we conducted and additional visualizations and results in Appendix A.2.
A. E XPERIMENTAL D ETAILS
Implementations.
We use the DER (Buzzega et al., 2020) open-source codebase 1 for all the experiments.
In particular, we reproduce all their experimental results for supervised continual learning and use various models with their set of hyper-parameters as our baselines.
We follow the original representations for SimSiam 2 and BarlowTwins 3 for unsupervised continual learning.
We verify our implementation by reproducing the reported results on CIFAR-10 in the original paper, where we train the representations on the complete CIFAR-10 dataset and evaluate on the test-set using
KNN classiﬁer (Wu et al., 2018). In particular, (Wu et al., 2018) stores the features for each instance in the task-level training set in a discrete memory bank.
The optimal feature-level embeddings are then learned by instance-level discrimination, which maximally scatters the features of the training samples.
Following prior works in representation learning, we use the task-level training set without any augmentation in the task-incremental setup for the supervised and unsupervised KNN evaluation.
Hyperparameter conﬁgurations.
We use the tuned hyper-parameters reported by Buzzega et al.
(2020) for all the SCL experiments.
On the other hand, we tune the hyper-parameters for continual learning strategies for UCL.
We provide the hyper-parameters setup for UCL for different datasets in Table A.5.
We train all the UCL methods with a batch size of 256 for 200 epochs.
For rehearsalbased methods, we use the buffer size 200 for Split CIFAR-10, Split CIFAR-100 and 256 for Split
Tiny-ImageNet dataset.
We use a learning rate of 0 : 03 for SGD optimizer with weight decay 5 eand momentum 0 : 9 .
all the datasets on ResNet-18 architecture.
M ETHOD
S PLIT CIFARS PLIT CIFARS EQ .
T INY -I MAGE N ET
S
I c : 100 (cid:24) :c : 0 : 1 (cid:24) :c : 0 : 01 (cid:24) :
P NN wd :wd :wd :
DER (cid:11) : 0 :(cid:11) : 0 :(cid:11) : 0 :
L UMP (cid:21) : 0 :(cid:21) : 0 :(cid:21) : 0 :
A. A DDITIONAL E XPERIMENTS
We provide additional loss landscape and feature visualizations on Split CIFAR-100 in Figure A. and Figure A.7 respectively.
Figure A.9 shows the feature visualizations for Split Tiny-ImageNet on
ResNet-18 architecture.
[Figure] [Figure]
[Figure] [Figure]