# What is the difference between learning without forgetting and transfer learning?

I would like to incrementally train my model with my current dataset and I asked this question on Github, which is what I'm using SSD MobileNet v1.

Someone there told me about learning without forgetting. I'm now confused between learning without forgetting and transfer learning. How they differ from each other?

My initial problem, what I'm trying to achieve (mentioned in Github issue) is the following.

I have trained my dataset on ssd_mobilenet_v1_coco model. I'm getting continuous incremental data. Right now, my dataset is very limited.

What I want to achieve is incremental training, i.e. as soon as I get new data, I can further train my already trained model and I don't have to retrain everything:

1. Save trained model $$M_t$$
2. Get new data $$D_{t+1}$$
3. Train $$M_t$$ on $$D_{t+1}$$ to produce $$M_{t+1}$$
4. Let $$t = t+1$$, then go back to $$1$$

How do I perform this incremental training/learning? Should I use LwF or transfer learning?

Learning without Forgetting (LwF) is an incremental learning (sometimes also called continual or lifelong learning) technique for neural networks, which is a machine learning technique that attempts to avoid catastrophic forgetting. There are several incremental learning approaches. LwF is an incremental learning approach based on the concept of regularization. In section 3.2 of the paper Continual lifelong learning with neural networks: A review (2019), by Parisi et al., other regularisation-based continual learning techniques are described.

LwF could be seen as a combination of distillation networks and fine-tuning, which refers to the re-training with a low learning rate (which is a very rudimentary technique to avoid catastrophically forgetting the previously learned knowledge) an already trained model $$\mathcal{M}$$ with new and (usually) more specific dataset, $$\mathcal{D}_{\text{new}}$$, with respect to the dataset, $$\mathcal{D}_{\text{old}}$$, with which you originally trained the given model $$\mathcal{M}$$.

LwF, as opposed to other continual learning techniques, only uses the new data, so it assumes that past data (used to pre-train the network) is unavailable. The paper Learning without Forgetting goes into the details of the technique and it also describes the concepts of feature extraction, fine tuning and multitask learning, which are related to incremental learning techniques.

What is the difference between LwF and transfer learning? LwF is a combination of distillation networks and fine-tuning, which is a transfer learning technique, which is a special case of incremental learning, where the old and new tasks are different, while, in general, in incremental learning, the old and new tasks can also be the same (which is called domain adaptation).

• TODO: This answer needs to be improved because the concept of "task" is not well defined here. Saying that the old and new tasks are the same in domain adaptation can be confusing, without a definition of "task". – nbro Nov 10 '20 at 13:07

What I want to achieve is incremental training. So, as soon as I get new data, I can further train my already trained model and I don't have to retrain everything.

Learning without forgetting is one of the methods to solve multitask learning. If your model trained to solve problem A and then after sometimes you need your model to solve new problem B without forgetting the problem A (the model still good to solve the problem A), then you need this.

Transfer learning is a method to use a trained model to solve another task (and may forget the original task). For example, you use a model that originally trained to classify cat or dog to a new task that trying to classify goat or cow. You use this in hopes of speeding up your training process.

If your new data has the same task with the old data, you don't need to use multitask learning method. For example:

• if your model trained with 50 images to detect an apple in the image, and then you get new 100 images to detect an apple then you just need to continue your train (incremental learning). In this case, you need (to save) the latest parameter of your model after trained (latest learning rate value, epoch, etc.), if you have it then you just need to run your training again (continue the epoch).
• if your model trained with 100 images to detect an apple in the image, and then you get new 100 images to train your model to detect an orange and you don't care if your model will give a bad result to detect an apple, then you can use transfer learning. You may freeze a few first layers as "extractor" and initialize a new layer at the end.
• if your model trained with 100 images to detect an apple in the image, and then you get new 100 images to detect an orange and your model must good to detect both apple and orange in an image, then you use multitask learning. The easiest method is to train your model with the apple+orange image, but you can also use another approach like proposed in Learning without Forgetting paper.