<ol>
<li>Accuracy is always 1 - see <a href="https://stackoverflow.com/a/39720541/1714410">this answer</a>.  </li>
<li><code>"EuclideanLoss"</code> layer is a good fit for regression.  </li>
<li>Subtracting the mean should help the net converge better. Keep using it. You can read more about the importance of data normalization and what can be done in that respect <a href="https://arxiv.org/abs/1502.01852" rel="nofollow noreferrer">here</a>.</li>
</ol>
Caffe loss layer, mean and accuracy
<p>I have a fully convotuional network for depth estimation like this: (only upper and lower layers for the sake of simplicity):</p>

<pre><code># input: image and depth_image
layer {
  name: "train-data"
  type: "Data"
  top: "data"
  top: "silence_1"
  include {
    phase: TRAIN
  }
  transform_param {
    #mean_file: "mean_train.binaryproto"
    scale: 0.00390625
  }
  data_param {
        source: "/train_lmdb"
    batch_size: 4
    backend: LMDB
  }
}
layer {
  name: "train-depth"
  type: "Data"
  top: "depth"
  top: "silence_2"
  include {
    phase: TRAIN
  }
  transform_param {
    scale: 0.00390625
  }
  data_param {
    source: "train_depth_lmdb"
    batch_size: 4
    backend: LMDB
  }
}
layer {
  name: "val-data"
  type: "Data"
  top: "data"
  top: "silence_1"
  include {
    phase: TEST
  }
  transform_param {
    #mean_file: "mean_val.binaryproto"
    scale: 0.00390625
  }
  data_param {
    source: "val_lmdb"
    batch_size: 4
    backend: LMDB
  }
}
layer {
  name: "val-depth"
  type: "Data"
  top: "depth"
  top: "silence_2"
  include {
    phase: TEST
  }
  transform_param {
    scale: 0.00390625
  }
  data_param {
    source: "val_depth_lmdb"
    batch_size: 4
    backend: LMDB
  }
}
################## Silence unused labels ##################
layer {
    name: "silence_layer_1"
    type: "Silence"
    bottom: "silence_1"
}

layer {
    name: "silence_layer_2"
    type: "Silence"
    bottom: "silence_2"
}
....
layer {
    name: "conv"
    type: "Convolution"
    bottom: "concat"
    top: "conv"
    convolution_param {
        num_output: 1
        kernel_size: 5
        pad: 2
        stride: 1
        engine: CUDNN
        weight_filler {
            type: "gaussian"
            std: 0.01
        }
        bias_filler {
            type: "constant"
            value: 0
        }
    }
}

layer {
    name: "relu"
    type: "ReLU"
    bottom: "conv"
    top: "result"
    relu_param{
    negative_slope: 0.01
        engine: CUDNN
    }
}

# Error
layer {
  name: "accuracy"
  type: "Accuracy"
  bottom: "result"
  bottom: "depth"
  top: "accuracy"
  include {
    phase: TEST
  }
}
layer {
  name: "loss"
  type: "EuclideanLoss"
  bottom: "result"
  bottom: "depth"
  top: "loss"
}
</code></pre>

<p>Now I have 3 questions:</p>

<p>When I am training the network the accuracy layer is always 1. I do not understand why?</p>

<p>Is EuclideanLayer the correct layer for this purpose?</p>

<p>Is the mean needed in such a case or can I neglect the mean?</p>

<pre><code>#Define image transformers
transformer = caffe.io.Transformer({'data': net.blobs['data'].data.shape})
transformer.set_mean('data', mean_array)
transformer.set_transpose('data', (2,0,1))

image = "test.png"

img = caffe.io.load_image(image, False)

img = caffe.io.resize_image( img, (IMAGE_WIDTH, IMAGE_HEIGHT))

net.blobs['data'].data[...] = transformer.preprocess('data', img)

pred = net.forward()

output_blob = pred['result']
</code></pre>