[Paper review] Incremental Meta-Learning via Indirect Discriminant Alignment, ECCV 2020

Ben Hsu
13 min readJan 31, 2021

--

會記錄這篇其實是因為這篇論文讀了幾次真的覺得,我果然是沒看懂 XD。紀錄一些看不懂的細節,讓之後有時間時再回顧。

文章鏈結:https://arxiv.org/abs/2002.04162

前言

這是一篇ECCV 2020的論文,作者群是Amazon science,這篇論文名字的變化過程有三個 "Incremental Learning for Metric-Based Meta-Learners" → "Incremental Meta-Learning via Indirect Discriminant Alignment" → "Incremental few-shot meta-learning via indirect discriminant alignment"。

從這個過程大致就可以看到這篇論文涵蓋了許多概念,但可以說是以meta-learning解決task-incremental 的 few-shot 問題。最早的名字提到這是屬於Metric based的方法,主要是因為這篇論文使用了Prototype Network作為meta-learner,但其實其他方式也是可以的。

這篇文章的題目訂的很大,提到自己是第一個使用Meta Incremental learning的方法。並且在2019年有幾篇論文在處理few-shot class-incremental learning的問題,但是作者在Discussion and Related Work寫了下面的話,直接點名兩篇使用attention network萃取meta資訊的不是few-shot method XD。

Despite being called incremental few-shot learning, these methods are more accurately described as incremental learning using few-shot datasets.

IML的概念

而Incremental meta-learning (IML)的概念,文章說明與meta-learning的不同

In IML, the meta-training set keeps changing, and we require both the performance of the model for the new tasks, as well as the base model, to improve.

也說明與incremental learning的差異

In IML, we want to continuously improve the meta-trained model so that, presented with an unseen task, it achieves better performance now that it would have before solving the previous task.

總的來說,IML希望在沒有使用re-process data的情況下,以new-task的資料增強meta-learner的泛用性,然後也要讓new-task分的好。但是,如果有舊資料可用,模型也是允許的。

論文貢獻

文章的主要貢獻,是論文名稱的後半截 Indirect Discriminant Alignment (IDA),文章提到,因為new-task與old-task的Classifier的類別是不同的,所以無法直接將old-task的Classifier資訊給new-task參考。而以前的解決方法是,將old-task的feature extractor的資訊給new-task做參考,這樣就沒有class不同的問題,這個方法被稱為Direct Feature Alignment (DFA)。但是這個方法文章覺得有改進的空間,原文如下:

However, this would be needlessly restrictive: Completely different features can yield the same posterior density, and we want to exploit this flexibility for incremental learning.

取而代之的作法,是在old-task時 (就是在meta stage),找到 "class anchors",透過這class anchors來對應new, old discriminant。這個anchors怎麼找晚點在說,不過Figure 1. 最後一段提到,透過這個方法後 incremental model會留下更多的自由度來調整 embedding來處理new-task的問題。

這個說法也不太好理解,這裡的自由度應該是統計學上統計量的自由度(因為這篇論文也使用了sufficient statistic、 hypothesis space,明顯中毒很深),而自由度與樣本數、估計參數量有關,如果在 5 way-5 shot中就是25個樣本。這裡的意思應該是,在沒有使用meta-learning時,自由度是25 - ???????;使用meta-learning後,參考了以前的資料,自由度會多一些,25-????。論文中只提到兩次,算提供一個概念,但我覺得沒有幫助理解的效果 XD。

訓練流程 - 第一階段

因為這篇文章是闡述Loss的設計,並套用到存在的多種網路之中,沒有網路結構可參考,所以需要多一點想像。分成兩個階段,第一階段是meta-training,他們從old dataset D 中抽取了few-show tasks τ,並且使用eq.(4) 作為loss function 。

其中τ就是meta training中的多個few-shot task,|Dτ|是資料集個數,p(y|x) = f(y|φ(x)),φ是backbone function,f是discriminant head。

這裡的ω,同時包含backbone與discriminant head的weight。一般來說,few-shot incremental learning的方法,在少量資料的狀況下,fine-tuning會導致old-task產生catastrophic forgetting,而new-task產生over-fitting,所以可能會選擇固定backbone的weight,但這裡的ω,是兩者都可動。

訓練流程 — 第二階段

第二個階段是Incremental model,他會從ε抽出τ'做為few-shot task,並且使用eq.(7) 作為loss function 。

eq(7)等式右邊分成兩個部分,第一的項目是前面一直在討論的loss,後面的項目是論文的主要貢獻IDA,IDA後面再談。t則訓練的階段,t就是前次訓練,t+1就是更新的Model。所以如果我們僅有一次incremental階段,則t+1就是incremental-training,t就是meta-training。eq(7)第二項給定了C^t,上標是t,這個C^t就是來自old task的class anchor。

eq(9)開始則說明了Class anchor的計算方式,這條eq(9)與eq(4)其實是一樣的,只是他是prototype network使用的metric,而z = φ(x),K是類別數量。但在這篇文章中定義了兩個Cτ,第一個Cτ = {c1,…,cK},這裡的Cτ是每個task下的類別數量,下方第二式的|Ck|指的就是單一類別集合的數量;第二個Cτ是這篇文章的精華class anchor,就是上式寫出來的Cτ = ψ(Dτ, k)。

消融實驗的各種條件

這裡會一併說明消融實驗有的6種情況,下一節再來看看詳細說說IDA在做什麼。而這篇因為是incremental learning,所以目標是模型對於Old class保有分類正確率也就是解決catastrophic forgetting的效果,同時提升New class的正確率,而因為prototype Net是支援zero shot的,所以還有一類是看對於Unseen class的分類效果。

No Update (NU)

No Update (NU)is the simplest baseline, that is a model meta-trained only using the old dataset. 這個就是baseline,僅僅使用舊task的資料,結果應該只有Old class會有效果,New class結果應該跟Unseen class相似。

Fine-Tuning (FT)

先以old data 做meta訓練,再以new data fine-tuning,但是沒有使用任何constraint,他的Loss如下

Direct Feature Alignment (DFA)

DFA是論文認為有改善空間的方法,他的問題在於他是直接對應更新前後的feature extractor,並沒有考慮到Classifier的資訊,Loss如下

Indirect Discriminant Alignment (IDA)

本文推薦的方法,就是eq(7)

Exemplar-based incremental meta-learning (EIML)

IDA使用的資料是new task的資料,而EIML在IDA之上加上另一個限制式,表示於eq(10)

eq(10)的第三個term是IDA,而第二個項目則是利用old data 的情況,相較於IDA,EIML多使用了old data的資訊。

Full training paragon (PAR)

這個是直接在meta階段使用old data與 new data,所以是upper bound 的 baseline。

Loss function的各個項目

在Distillation的章節有提到,有一些調整loss的方法是透過擾動 (perturbing) weights ,像是先前提到的DFA,直接以feature更新前、後的方式調整;而Distillation則是透過擾動discriminant function來調整,也就是posterior density, p(y|x),比較調整前後的p來更新weight。好處就是同時考慮到discriminant function與 backbone的weight。

而他調整的方式,是以KL divergence比較擾動前後posterior density的變化。可以寫成eq(6)

如果對比eq(7) IDA的項目可以發現,IDA(φ_{t+1} |φ_t{t}) = E[KL(f(φ_{t}||φ_{t+1}))],因為KL divergence是非對稱的衡量指標,所以一定是IDA(new | old) = E (KL (f(old) || f(new)))

而直白的解讀eq(6),可以理解,他是以new-task的資料τ',通過更新前、後的feature extractor,然後以更新前的discriminant function得到機率分布,這時再以KL divergence衡量。看似好像很合理,不過從這裡還沒說明Class anchor用在哪裡。

Appendix的eq(13) - eq(16) 說明了Class anchor的計算,不過eq(14)讓我有些疑惑,因為這裡的寫的是IFA,但是feature alignment應該是不包含discriminant function,不會使用KL divergence,一開始我認為是筆誤,但Figure 1.中也是寫IFA,所以不太確定代表的意義。

而這裡的eq(14)與前面稍微有些不同,所以整理一下整篇論文用到的IDA算式,eq(6)與eq(10)是一樣的。這裡的f下標,指的不是更新前、後的discriminant head,而是更新前、後的feature extractor。如果認為這個 f 指的是discriminant head,什麼鬼都算不出來。

不管如何,先看看eq(14),discriminant head 的下標,是控制φ的,如下:

這時候回頭看看EIML是怎樣算的

如果把它寫出式子應該是如下面這樣,第三式是推測,更新後的f head,意思是裡面的class anchor也更新了。寫到這裡應該所有的算式都看懂了(或是都猜過一輪)。

小結

實驗結果就不列了,這篇文章還沒有Code可以看,內容猜測的無法驗證。最神奇的還是他的Table 6,他做了2次的incremental training,因為這篇文章提到他要透過new-task來提升meta-learner,而這個表格的round II 確實證實了,他在old classes IDA的平均表現超過了NU,同時New class IDA的平均表現也超過了FT與DFA,同時輾壓的狀況在Round I是不曾出現的

--

--