Help providing for understanding and creating a model of a neural network

63 views
Skip to first unread message

Stefan Cvetkovski

unread,
Nov 9, 2015, 7:31:24 AM11/9/15
to Caffe Users
Greetings,

I am currently new to Deep Learning (Image segmentation) problems, and also new with caffe framework.

I found a paper "Deep Neural Networks Segment Neuronal Membranes in Electron Microscopy Images", and I want to replicate the results, but I am having problem with constructing the following network:

Layer          Type                   Maps and neurons                   Kernel size
  0         input                       1 map of 95x95 neurons
  1         convolutional         48 maps of 92x92 neurons               4x4
  2         max pooling          48 maps of 46x46 neurons                2x2
  3         convolutional        48 maps of 42x42 neurons                5x5
  4         max pooling          48 maps of 21x21 neurons                2x2
  5         convolutional        48 maps of 18x18 neurons                4x4
  6         max pooling         48 maps of 9x9 neurons                    2x2
  7         convolutional        48 maps of 6x6 neurons                   4x4
  8         max pooling         48 maps of 3x3 neurons                    2x2
  9         fully connected        200 neurons                                  1x1
 10       fully connected           2 neurons                                    1x1

I want to train my network for image segmentation.
Part from my codes are on github including the script from where I generate my train and validation set, also my current neural network model which is giving me:
1. Out of memory error
2. I fix this error, but the accuracy for predicting the label for a given pixel is 0.33% (a prof that my network is not learning, the probability for a pixel to belong for 1 of 3 labels is 1/3).

I am new to Deep Learning and convolution network, and I don't understand how to present the "maps" in the caffe layer. Also what is the different between maps, filters, kernel size and how you compute the input and output from a convolution network.

My specifications are:
OS: Ubuntu Server 14.04
CPU: i7-4790 4.60GHz x 8
RAM: 8Gb
GPU: nVidia GeForce GTX 980

I will appreciate your help, also if you are interested in replicating this results please write me. 
Thank you for your time :)

Jan C Peters

unread,
Nov 9, 2015, 10:11:18 AM11/9/15
to Caffe Users
You should have a look at the caffe examples to acquaint yourself with how caffe handles things. In particular, read http://caffe.berkeleyvision.org/tutorial/ and all its subpages.

When you have done this look at the caffe.proto and see which parameter maps to the values you want to set. E. g. the number of maps you have there corresponds to the number of filters in your respective convlayer, the exact name of the param is "num_output" (line 495 in caffe.proto). The "AxB neurons" is just the size of the produced feature maps, which caffe computes automatically, you just have to set the "kernel_size" and "stride" parameters accordingly (In your case, you don't need padding, stride is always 1, kernel_size is exactly as written in the fourth column every time). Try to figure out how to correctly set the params of the pooling layers.

Jan

ath...@ualberta.ca

unread,
Nov 10, 2015, 12:46:33 PM11/10/15
to Caffe Users
I highly recommend this CNN course from Stanford: http://cs231n.stanford.edu.

Stefan Cvetkovski

unread,
Nov 12, 2015, 7:36:52 AM11/12/15
to Caffe Users
Thank you Jan,

you made some things clear to me. I didn't know it was that simple. I created the whole network, I have no problems for now.

Again thank you for your help :)
Reply all
Reply to author
Forward
0 new messages