『論文筆記』Connectionist Temporal Classification with Maximum Entropy Regularization


論文地址:https://papers.nips.cc/paper/7363-connectionist-temporal-classification-with-maximum-entropy-regularization.pdf

https://zhuanlan.zhihu.com/p/82302872

CTC的問題:

1、容易陷入局部最優

2、尖峰分布

 

 作者認為peak distribution是一種過擬合的表現,

However, CTC tends to produce highly peaky and overconfident distributions, which is a symptom of overfitting.

由於CTC可以認為是多實例學習的一種,CTC中的標簽事件可以看做是所有可行路徑的包(即多條路徑經過many-to-one操作后輸出相同的字符串):

CTC can be regarded as a kind of Multiple Instance Learning (MIL). From the perspective of MIL, the label sequence is a bag containing all feasible paths.

如果某條路徑的概率較大,那么CTC會加強該路徑直至占有所有路徑的絕大部分,是一種正向激勵的作用。且由於blank在多數路徑都存在,blank也會加強,直至充滿主要路徑,使得non-blank labels只占有尖峰,即CTC尖峰分布問題:

As blanks are included in most of the feasible paths, dominant paths are often overwhelmed by blanks, interspersed by sharp spikes (narrow regions along the time axis) of non-blank labels, which is known as the CTC peaky distribution problem.

這種現象會帶來很多問題:

  1. Harm the training process.對路徑的正向激勵導致網絡容易陷入局部最小值之中。
  2. Output overconfident paths.尖峰的存在在某些應用場景不適合,比如語音識別中的相鄰音節,另外,較低的熵也可以看做是過擬合的一種。
  3. Output paths with peaky distribution.尖峰的存在不適合序列分割任務。

EnCTC

論文提出了基於最大熵的正則化方法EnCTC去抑制最大概率路徑的存在:

To remedy this, we propose a regularization method based on maximum conditional entropy which penalizes peaky distributions and encourages exploration.

最大熵的公式為

 [公式]

由於 [公式] 在 [公式] 區間的曲線為:

CTC的損失函數為:

[公式]

其中, [公式]

梯度為:

[公式]

由於只有部分路徑包含 [公式] ,所以只需要考慮包含 [公式]的部分路徑對[公式]的偏導即可。

[公式] ,因此有:

[公式]

論文認為上式可以推導出 [公式] 的梯度與經過該點所有路徑的概率(即 [公式] )之和相關,且概率與梯度成正比關系,論文認為這是導致尖峰存在的原因:

We can see that the error signal is proportional to the fraction of all feasible paths that go through symbol [公式] at time [公式] . That means once a feasible path is dominant, the error signal of [公式] will dominate [公式] at all time-steps [公式] , causing all the probabilities to focus on a single path while ignoring its alternatives.

論文在損失函數里加入了最大熵部分:

[公式]

其中, [公式]

論文發現在該損失部分概率接近0的路徑貢獻了損失的大部分(這里論文推導了一些公式,如果有興趣可查看論文),這對訓練的多樣性是有用的:

Therefore, paths with probability between 0 and [公式] , i.e. paths near the the dominant path, contribute the most to the error signal. This error signal will in turn increase the probability of the nearby paths and improve the exploration during training.
類似於CTC原始loss的計算方式,這里作者用動態規划設計了loss的傳播方式,下圖中的delta p表示本t對應點的概率,p表示前一個時間步驟可行的點的累積概率,可見傳播過程可以部分復用ctc的結果(即alpha):

 

 EsCTC

由於ctc的gt是近似等間隔的,作者希望利用這個性質約束可行路徑

 

 

 

如下面的圖中一般人寫dog其各個字母大小差距不會太大(1、2結果不太可能,3比較合理),基於此作者提出了分區的CTC,即限制每個輸出只能在一定長度之間:

 

同樣給出了動態規划算法,先計算每一小段的概率:

 

 

 輸出s小段的概率,初始化第一行表示第一小段內部直接沿用上面slice的結果:

 

為啥這個也交最大熵:

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM