Training Deconvolution Layer (fcn.berkeleyvision.org)

1,341 views
Skip to first unread message

Ark

unread,
May 30, 2016, 2:47:55 AM5/30/16
to Caffe Users
Hello,

Using the fcn_alexnet provided at https://github.com/shelhamer/fcn.berkeleyvision.org, I could replicate the meanIU=48 as given in the FCN Paper (but with unnormalized loss and reduced base_lr instead of normalized loss as given in the repo).

But I am a little confused on the deconvolution layer parameters here:

1. Paper describes initializing the deconv layer with bilinear filter coefficients and train them. But in the provided train/val.prototxt, we can see lr_mult=0, which means, deconv layer is not trained. Any idea why and how does it affect the accuracy?
2. Previous fcn files used group=21 in the deconv layer. But now, they are removed. Any idea how does it affect the accuracy?

Best Regards,
ARK

Evan Shelhamer

unread,
Jul 25, 2016, 5:48:21 PM7/25/16
to Ark, Caffe Users
1. Paper describes initializing the deconv layer with bilinear filter coefficients and train them. But in the provided train/val.prototxt, we can see lr_mult=0, which means, deconv layer is not trained. Any idea why and how does it affect the accuracy?

​In further experiments​ on PASCAL VOC we found that learning the interpolation parameters made little difference, and fixing these weights gives a slight speed-up since the interpolation filter gradient can be skipped.

Keep in mind that there is only one channel per class in this particular architecture, so not that much is there to be learned except perhaps for the spatial extent of the kernel. The results for other data (with more scale variation) or other architectures (with more deconvolution channels and layers) could differ.


 2. Previous fcn files used group=21 in the deconv layer. But now, they are removed. Any idea how does it affect the accuracy?

​These are equivalent as long as these parameters are not learned. In the group case, the no. of groups is equal to the no. of channels so that each class is interpolated separately. ​In the no group case, only the "diagonal" of the weight matrix is initialized to the bilinear filter kernels so that each class is likewise interpolated separately with all cross-channel weights set to zero.
 

​Happy brewing,​


Evan Shelhamer





--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/bca0c4f4-a738-430b-8e5b-ffd2de8393de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

zhiyi Luo

unread,
Nov 24, 2016, 10:32:47 PM11/24/16
to Caffe Users, ab...@auvizsystems.com
Dear Evan,
I do not find bilinear init in voc-fcn32s/train.prototxt, so I add `weight_filler {type: "bilinear"} ` in the "upscore" deconv layer, and train about 1000 iterations.
But I found my trained "snapshot/train_iter_1000.caffemodel" is different from "fcn32s-heavy-pascal.caffemodel" on upscore layer.
    net0 = caffe.Net('voc-fcn32s/deploy.prototxt', 'voc-fcn32s/snapshot/train_iter_1000.caffemodel', caffe.TEST)
    net1 = caffe.Net('voc-fcn32s/deploy.prototxt', 'voc-fcn32s/fcn32s-heavy-pascal.caffemodel', caffe.TEST)
    net0.params['upscore'][0].data
    [[ 0.00024414,  0.00073242,  0.0012207 , ...,  0.0012207 ,
           0.00073242,  0.00024414],
         [ 0.00073242,  0.00219727,  0.00366211, ...,  0.00366211,
           0.00219727,  0.00073242],
         [ 0.0012207 ,  0.00366211,  0.00610352, ...,  0.00610352,
           0.00366211,  0.0012207 ],
         ..., 
         [ 0.0012207 ,  0.00366211,  0.00610352, ...,  0.00610352,
           0.00366211,  0.0012207 ],
         [ 0.00073242,  0.00219727,  0.00366211, ...,  0.00366211,
           0.00219727,  0.00073242],
         [ 0.00024414,  0.00073242,  0.0012207 , ...,  0.0012207 ,
           0.00073242,  0.00024414]],

        [[ 0.00024414,  0.00073242,  0.0012207 , ...,  0.0012207 ,
           0.00073242,  0.00024414],
         [ 0.00073242,  0.00219727,  0.00366211, ...,  0.00366211,
           0.00219727,  0.00073242],
         [ 0.0012207 ,  0.00366211,  0.00610352, ...,  0.00610352,
           0.00366211,  0.0012207 ],
         ..., 
         [ 0.0012207 ,  0.00366211,  0.00610352, ...,  0.00610352,
           0.00366211,  0.0012207 ],
         [ 0.00073242,  0.00219727,  0.00366211, ...,  0.00366211,
           0.00219727,  0.00073242],
         [ 0.00024414,  0.00073242,  0.0012207 , ...,  0.0012207 ,
           0.00073242,  0.00024414]]]], dtype=float32)

      net1.params['upscore'][0].data
        [[ 0.        ,  0.        ,  0.        , ...,  0.        ,
           0.        ,  0.        ],
         [ 0.        ,  0.        ,  0.        , ...,  0.        ,
           0.        ,  0.        ],
         [ 0.        ,  0.        ,  0.        , ...,  0.        ,
           0.        ,  0.        ],
         ..., 
         [ 0.        ,  0.        ,  0.        , ...,  0.        ,
           0.        ,  0.        ],
         [ 0.        ,  0.        ,  0.        , ...,  0.        ,
           0.        ,  0.        ],
         [ 0.        ,  0.        ,  0.        , ...,  0.        ,
           0.        ,  0.        ]],

        [[ 0.00024414,  0.00073242,  0.0012207 , ...,  0.0012207 ,
           0.00073242,  0.00024414],
         [ 0.00073242,  0.00219727,  0.00366211, ...,  0.00366211,
           0.00219727,  0.00073242],
         [ 0.0012207 ,  0.00366211,  0.00610352, ...,  0.00610352,
           0.00366211,  0.0012207 ],
         ..., 
         [ 0.0012207 ,  0.00366211,  0.00610352, ...,  0.00610352,
           0.00366211,  0.0012207 ],
         [ 0.00073242,  0.00219727,  0.00366211, ...,  0.00366211,
           0.00219727,  0.00073242],
         [ 0.00024414,  0.00073242,  0.0012207 , ...,  0.0012207 ,
           0.00073242,  0.00024414]]]], dtype=float32)

which means net0.params['upscore'][0].data[0,0,:,:] and net1.params['upscore'][0].data[0,0,:,:] are all the same.
However, net1.params['upscore'][0].data[0,1,:,:] are all zeros, net0.params['upscore'][0].data[0,0,:,:] are not.

Where am I wrong?
Thanks a lot.

在 2016年7月26日星期二 UTC+8上午5:48:21,Evan Shelhamer写道:
Reply all
Reply to author
Forward
0 new messages