My goal is to train a neural Network with
- inputs of type 160x160x5 double (5 channels of images with 160x160 pixels each) and
- responses of type 160x160 categorical (pixel-wise labels with 2 classes)
as there are N samples, they are given as
- input: 160x160x5xN double
- response: 160x160x1xN categorical
The network layers map a 160x160x5 input to a 160x160x2 output (2 classes) and is taken from the example by mathworks. It has the following structure: 1 Image Input 160x160x5 images with 'zerocenter' normalization
2 Convolution 64 3x3 convolutions with stride [1 1] and padding [1 1 1 1]
3 Batch Normalization Batch normalization
4 ReLU ReLU
5 Max Pooling 2x2 max pooling with stride [2 2] and padding [0 0 0 0]
6 Transposed Convolution 16 4x4 transposed convolutions with stride [2 2] and output cropping [1 1]
7 Batch Normalization Batch normalization
8 ReLU ReLU
9 Convolution 2 1x1 convolutions with stride [1 1] and padding [0 0 0 0]
10 Softmax softmax
11 Pixel Classification Layer Class weighted cross-entropy loss with classes 'healthy' and 'cancer'
How can I train a network with them? Following code fails :
[net, info] = trainNetwork(input,response,layers,options);
According to the error message, it seems as if the the layers are defined correctly, but the response tensor is internally reduced to beeing 1x1x2 big instead of 160x160x2.
Comment on edit: changed no of classes to 2, added description of layers