Facepoint regression

35 views
Skip to first unread message

sam sk

unread,
Jun 5, 2016, 3:56:45 AM6/5/16
to Caffe Users
Hi,
I am new to ML and Caffe. I am trying to code CNN_facepoint paper using regression.
I am training using approx 4000 images dataset and same hd5 file for testing.
My network is predicting same 10 values for different test images when I use deploy.prototxt


name: "facepoint"
layer {
  name: "data"
  type: "HDF5Data"
  top: "data"
  top: "label"
  include: {
    phase: TRAIN
  }
  hdf5_data_param {
    source: "/home/smk/deep-learning/caffe/examples/facepoint/train_file_location.txt"
    batch_size: 10
  }
}
layer {
  name: "data"
  type: "HDF5Data"
  top: "data"
  top: "label"
  include: {
    phase: TEST
  }
  hdf5_data_param {
    source: "/home/smk/deep-learning/caffe/examples/facepoint/train_file_location.txt"
    batch_size: 10
  }
}
layer {
  name: "conv1"
  type: "Convolution"
  bottom: "data"
  top: "conv1"
  param {
    lr_mult: 1
  }
  param {
    lr_mult: 2
  }
  convolution_param {
    num_output: 20
    pad: 0
    kernel_size: 4
    stride: 1
    weight_filler {
      type: "gaussian"
      std: 0.0001
    }
    bias_filler {
      type: "constant"
    }
  }
}

layer {
  name: "tanh1"
  bottom: "conv1"
  top: "tanh1"
  type: "TanH"
}

layer {
  name: "abs1"
  type: "AbsVal"
  bottom: "tanh1"
  top: "abs1"
}

layer {
  name: "pool1"
  type: "Pooling"
  bottom: "abs1"
  top: "pool1"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 2
  }
}






layer {
  name: "conv2"
  type: "Convolution"
  bottom: "pool1"
  top: "conv2"
  param {
    lr_mult: 1
  }
  param {
    lr_mult: 2
  }
  convolution_param {
    num_output: 40
    pad: 0
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}
layer {
  name: "tanh2"
  bottom: "conv2"
  top: "tanh2"
  type: "TanH"
}
layer {
  name: "abs2"
  type: "AbsVal"
  bottom: "tanh2"
  top: "abs2"
}

layer {
  name: "pool2"
  type: "Pooling"
  bottom: "abs2"
  top: "pool2"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 2
  }
}


layer {
  name: "conv3"
  type: "Convolution"
  bottom: "pool2"
  top: "conv3"
  param {
    lr_mult: 1
  }
  param {
    lr_mult: 2
  }
  convolution_param {
    num_output: 60
    pad: 0
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}

layer {
  name: "tanh3"
  bottom: "conv3"
  top: "tanh3"
  type: "TanH"
}
layer {
  name: "abs3"
  type: "AbsVal"
  bottom: "tanh3"
  top: "abs3"
}

layer {
  name: "pool3"
  type: "Pooling"
  bottom: "abs3"
  top: "pool3"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 2
  }
}

##

layer {
  name: "conv4"
  type: "Convolution"
  bottom: "pool3"
  top: "conv4"
  param {
    lr_mult: 1
  }
  param {
    lr_mult: 2
  }
  convolution_param {
    num_output: 80
    pad: 0
    kernel_size: 2
    stride: 1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}

layer {
  name: "tanh4"
  bottom: "conv4"
  top: "tanh4"
  type: "TanH"
}
layer {
  name: "abs4"
  type: "AbsVal"
  bottom: "tanh4"
  top: "abs4"
}


##

layer {
  name: "ip1"
  type: "InnerProduct"
  bottom: "abs4"
  top: "ip1"
  param {
    lr_mult: 1
  }
  param {
    lr_mult: 2
  }
  inner_product_param {
    num_output: 120
    weight_filler {
      type: "gaussian"
      std: 0.1
    }
    bias_filler {
      type: "constant"
    }
  }
}
layer {
  name: "relu2"
  type: "ReLU"
  bottom: "ip1"
  top: "ip1"
}

layer {
  name: "ip2"
  type: "InnerProduct"
  bottom: "ip1"
  top: "ip2"
  param {
    lr_mult: 1
  }
  param {
    lr_mult: 2
  }
  inner_product_param {
    num_output: 10
    weight_filler {
      type: "gaussian"
      std: 0.1
    }
    bias_filler {
      type: "constant"
    }
  }
}
layer {
  name: "relu2"
  type: "ReLU"
  bottom: "ip2"
  top: "ip2"
}
layer {
  name: "loss"
  type: "EuclideanLoss"
  bottom: "ip2"
  bottom: "label"
  top: "loss"
  
}

sam sk

unread,
Jun 7, 2016, 8:51:43 AM6/7/16
to Caffe Users
 I also tried a smaller dataset of 50 images only so network may overfit. but still training loss is get stuck at 0.74xxx. Image size 39*39 grayscal. normalized to (0,1) labels also normalized (0,1)


Reply all
Reply to author
Forward
0 new messages