感知野的概念尤為重要,對於理解和診斷CNN網絡是否工作,其中一個神經元的感知野之外的圖像並不會對神經元的值產生影響,所以去確保這個神經元覆蓋的所有相關的圖像區域是十分重要的;
需要對輸出圖像的單個像素進行預測的任務,使每一個輸出像素具有一個比較大的感知野是十分重要的,在做預測試時,每一個關鍵的信息就不會被遺漏。
增大感知野的方法: 理論上可以通過搭建更多的層的網絡實現感知域的線性增加,靠着卷積過濾器的增加; 也可以使用下采樣的方法,池化,增加感知域,目前通常都結合了這兩種技術;
堆疊不同層的convnets, 最后輸出矩陣的單個神經元的表征的感知域的大小顯然不一樣;感知域越大,這意味着它應該學習距離更遠的對象之間的關系
empirical, 層數越深, 能夠感知的patch的尺寸也越大,但是這樣會付出更多的計算成本和時間消耗,所以需要通過traceback:
function receptive_field_sizes() % compute input size from a given output size f = @(output_size, ksize, stride) (output_size - 1) * stride + ksize; %% n=1 discriminator % fix the output size to 1 and derive the receptive field in the input out = ... f(f(f(1, 4, 1), ... % conv2 -> conv3 4, 1), ... % conv1 -> conv2 4, 2); % input -> conv1 fprintf('n=1 discriminator receptive field size: %d\n', out); %% n=2 discriminator % fix the output size to 1 and derive the receptive field in the input out = ... f(f(f(f(1, 4, 1), ... % conv3 -> conv4 4, 1), ... % conv2 -> conv3 4, 2), ... % conv1 -> conv2 4, 2); % input -> conv1 fprintf('n=2 discriminator receptive field size: %d\n', out); %% n=3 discriminator % fix the output size to 1 and derive the receptive field in the input out = ... f(f(f(f(f(1, 4, 1), ... % conv4 -> conv5 4, 1), ... % conv3 -> conv4 4, 2), ... % conv2 -> conv3 4, 2), ... % conv1 -> conv2 4, 2); % input -> conv1 fprintf('n=3 discriminator receptive field size: %d\n', out); %% n=4 discriminator % fix the output size to 1 and derive the receptive field in the input out = ... f(f(f(f(f(f(1, 4, 1), ... % conv5 -> conv6 4, 1), ... % conv4 -> conv5 4, 2), ... % conv3 -> conv4 4, 2), ... % conv2 -> conv3 4, 2), ... % conv1 -> conv2 4, 2); % input -> conv1 fprintf('n=4 discriminator receptive field size: %d\n', out); %% n=5 discriminator % fix the output size to 1 and derive the receptive field in the input out = ... f(f(f(f(f(f(f(1, 4, 1), ... % conv6 -> conv7 4, 1), ... % conv5 -> conv6 4, 2), ... % conv4 -> conv5 4, 2), ... % conv3 -> conv4 4, 2), ... % conv2 -> conv3 4, 2), ... % conv1 -> conv2 4, 2); % input -> conv1 fprintf('n=5 discriminator receptive field size: %d\n', out);
作者發現 並不是所有在感知域中的像素 都圖對於輸出單元具有相同的貢獻: 直觀的來說,感知野中間的像素對於輸出會有更大的影響。
前向傳播中,感知野中間的像素能夠傳播信息到輸出通過許多不同的路徑,邊緣的像素就相對較少。這就造成了,在反向中,通過這些路徑傳來的梯度,使得中間像素有更大量級的梯度更新。(In the forward pass, central pixels can propagate information to the output through many different paths, while the pixels in the outer area of the receptive field have very few paths to propagate its impact. In the backward pass, gradients from an output unit are propagated across all the paths, and therefore the central pixels have a much larger magnitude for the gradient from that output).
實驗
如圖,感知野的影響分布是呈現高斯分布的, 作者發現了 理論感知域中的有效部分其實是非常微小的,因為高斯分布從中間衰減得十分的快。
實驗的目的是:確定多少個輸入感知野的像素點影響着輸出神經元;
--如上圖所示,在殘差網絡中不使用池化和下采樣方法,隨着訓練的進行,有效感知野的范圍在提升,同時即時感知野的大小已經大於了整個圖像的整個大小,有效感知野的范圍還是不能夠覆蓋整個圖像。
--在殘差網絡架構的模型中,使用subsampling 技術,理論感知域增加的非常大,但是有效感知域也是十分小的(如上圖的右邊Cam所示,堆疊多個VGG);有效減緩 有效感知域的高斯分布的方法帶來的影響
-- 和直接搭建多層卷積網絡相比,下采樣和擴張卷積( dilate conv)技術都可以增大有效感知野的大小,如下圖所示:
如何有效的對抗感知野的高斯分布呢?
-- 操縱權重的初始化 使卷積核中心的權值更小,外部的權值更大,優化 w 去最大化 有效感知野的大小。
解決這個優化問題,就得到了這樣一個解:在卷積核的4個角上平均分配權值,而其他地方都為0,===》得到一些 這樣分布的初始化方法 可以提高整體的速度
-- 認為 從CNN的結構來看是一個很好的增大有效感知域的措施,比如 dilate conv,skip-connection 使得感知野更小了,dropout 並不會改變有效感知野
思考
很多方法的模型並沒有考慮有效感知野,而是默認搭建的模型理論感知野和圖像的大小差不多就為最佳,其實有效感知野只是一小部分,存在模型性能的加大提升空間;
可以在現有方法的改進中,引入有效感知野的想法,使用擴張卷積和逆高斯分布的權重初始化等方法,抵消感知野的高斯分布影響;