training FCN 8s

1,689 views
Skip to first unread message

johnlo...@gmail.com

unread,
Feb 21, 2016, 11:38:46 AM2/21/16
to Caffe Users
Hello guys, im quite new to the caffe framework. Im actually trying to use fcn 8s network. I have successfully tested it on few examples.

But now I want to learn that network on my data set. For example i would like to see if the fcn can be learned only with one class, like sea, trees, highways etc.
I tried to find how to learn net with my own data, but i couldnt find anything that would help. Lets take for example sea. I know, I have to prepare images with sea and annotated them somehow. ( how to annotate them?)
After this, how can I learn that net? I know, I have to make it in lmbd, but how.. there are few examples, but without showing how to work with annotation.( Or does using FCN 8s really need annotated images?)

Thanks for any kind of help and I think answers to these questions would really help to other people, who struggle with training their own network.

Nam Vo

unread,
Feb 21, 2016, 12:41:44 PM2/21/16
to Caffe Users
You need data (images & labels)
The label depends on the task, i.e. whatever output that you want, for example if you want output yes/no, your label is yes/no, you want a segmentation map, your label is a segmentation map, I guess this is the case of FCN.
To train the network you need data layer that can read your data (images & labels). Now you can store your data in anyway you want, as long as there's a suitable, or you write a suitable data layer to read them.

For example, your input is a 200x200 image, and you want to classify each pixel is sea/non-sea, so your label is a 200x200 array segmentation map, you can put this array into, say, a text file, and then write a data layer that reads it.

Caffe comes with some data layers, and if you are to use them you have to follow their input format. For example if you want to use lmdb data layer, then you have to learn lmdb first, then write a program to convert your text file data to lmdb data, it's most likely that you have to look at caffe code to see how caffe access lmdb and organize your data accordingly.
I've never use lmdb layer, so I don't know the specific. If you are not writing your own layer, I suggest using the image data layer.

PS, it seems that this FCN is not like typical caffe task, so if you are to train you'll have to do a lot of coding & tinkering.

Nam Vo

unread,
Feb 21, 2016, 12:46:10 PM2/21/16
to Caffe Users
It seems that the network was trained on PASCAL dataset, you should take a look at that dataset first, see if you can train on that data.

Hamidreza Farhidzadeh

unread,
Jul 8, 2016, 11:26:05 AM7/8/16
to Caffe Users
I hope you got your answers now Anyway I found the good link for your porpuses


You can follow the sessions.


On Sunday, February 21, 2016 at 11:38:46 AM UTC-5, johnlo...@gmail.com wrote:

DIEGO GABRIEL

unread,
Mar 6, 2017, 3:53:23 PM3/6/17
to Caffe Users
Hello, I am also new in caffe, I would like to know if someone has trained the FCN Alexnet model with the BSDS500 dataset, because my BSDS500 tags already have the same colormap as PASCAL VOC 2012, but in inference it only segments the background (it shows me a black image). I think it's because I'm not initializing well the parameters in the data layer, does anyone know what parameters to assign to this layer to properly train with the BSDS500 dataset. 

What I did to train the FCN-Alexnet model with the images of the BSDS500 dataset was the following:

- I selected the BSDS500 images and tags that had one of the 20 objects in the list, leaving the rest of the image as background.
- I changed the colormap of the tags in the BSDS500 dataset to the tags in the PASCAL VOC 2012 dataset.
-  I have also put borders to the labels of the BSDS500 to have them the same as those of PASCAL VOC 2012.
- I am also using knowledge transfer from the pre-trained FCN Alexnet model.

Any answer would be much appreciated.

Thank you very much!
Reply all
Reply to author
Forward
0 new messages