1. 程式人生 > 其它 >On Recognizing Texts of Arbitrary Shapes with 2D Self-Attention

On Recognizing Texts of Arbitrary Shapes with 2D Self-Attention

和用LSTM的方法對比,

transform相比主要區別在於編碼器上,由3部分構成

1Shallow CNN,用於控制計算量

2Adaptive 2D positional encoding

論文中說Transformer的Position Encoding模組可能在視覺作用中起不了作用,但是位置資訊又很重要,尤其是論文致力於解決任意形狀的文字識別問題,作者對位置編碼進行了可學習的自適應,目的是

E是影象卷積特徵,g是池化操作,然後經過線性層分別得到alpha和beta,再分別針對影象的h,w得到編碼資訊(按照Transformer位置編碼方式)。

識別出的α和β直接影響高度和寬度位置編碼,以控制水平軸和垂直軸之間的相對比率,以表達空間分集。通過學習從輸入推斷出α和β,A2DPE允許模型沿高度和寬度方向調整長度元素。
We visualize random input images from three groups with different predicted aspect ratios, as a by-product of A2DPE. Figure 7 shows the examples according to the ratios α/β. Low aspect ratio group, as expected, contains mostly horizontal samples, and high aspect ratio group contains mostly vertical samples. By dynamically adjusting the grid spacing, A2DPE reduces the representation burden for the other modules, leading to performance boost.

3Locality-aware feedforward layer

For good STR performance, a model should not only utilize long-range dependencies but also local vicinity around single characters.

作者認為transformer的自監督長在長距離的關係處理,local關係處理的並不夠好,所以feedforward位置作者做了從ac的替換,提升相近特徵間的互動。

 

512-d的不同step的特徵利用卷積進行特徵互動,屬於transformer對cv區域性特徵的一種融合,感覺應該有一定作用。