Facial Keypoints Detection using Caffe

440 views
Skip to first unread message

dong sui

unread,
Feb 1, 2015, 3:50:05 AM2/1/15
to caffe...@googlegroups.com
Hi all,

I am using Caffe to do this http://danielnouri.org/notes/2014/12/17/using-convolutional-neural-nets-to-detect-facial-keypoints-tutorial/#second-model-convolutions

I have the same parameter and net with him,

name: "face_detection"

layers
{
  name
: "face_detection"
  top
: "data"
  top
: "label"
  type
: HDF5_DATA
  hdf5_data_param
{
    source
: "train"
    batch_size
:128
 
}
  include
{
    phase
: TRAIN
 
}
}

layers
{
  name
: "face_detection"
  type
: HDF5_DATA
  top
: "data"
  top
: "label"
  hdf5_data_param
{
    source
: "test"
    batch_size
:128
 
}
  include
: {phase: TEST}
}




layers
{
  bottom
:"data"
  top
:"conv1"
  name
: "conv1"
  type
: CONVOLUTION
  blobs_lr
:1
  blobs_lr
:2
  convolution_param
{
    num_output
:32
    kernel_size
:3
    weight_filler
{
      type
:"gaussian"
      std
:0.0001
   
}
    bias_filler
{
      type
:"constant"
   
}
 
}
}

layers
{
  name
: "relu1"
  type
: RELU
  bottom
: "conv1"
  top
: "conv1"
}

layers
{
  name
: "pool1"
  type
: POOLING
  bottom
: "conv1"
  top
: "pool1"
  pooling_param
{
    pool
:MAX
    kernel_size
: 2
    stride
: 2
 
}
}


layers
{
  name
: "conv2"

  type
: CONVOLUTION
  bottom
: "pool1"
  top
: "conv2"
  blobs_lr
:1
  blobs_lr
:2
  convolution_param
{
    num_output
: 64  
    kernel_size
: 2
    weight_filler
{
      type
: "gaussian"
      std
: 0.01
   
}
    bias_filler
{
      type
:"constant"
   
}
 
}
}
 
layers
{
  name
: "relu2"
  bottom
:"conv2"
  top
: "conv2"
  type
:RELU
}

layers
{
  name
: "pool2"
  type
: POOLING
  bottom
: "conv2"
  top
: "pool2"
  pooling_param
{
    pool
:MAX
    kernel_size
: 2
    stride
: 2
 
}
}
 



layers
{
  name
: "conv3"
  bottom
:"pool2"
  top
: "conv3"
  type
: CONVOLUTION
  blobs_lr
: 1
  blobs_lr
: 2
  convolution_param
{
    num_output
:128
    kernel_size
: 2
    weight_filler
{
      type
: "gaussian"
      std
:0.01
   
}
    bias_filler
{
      type
:"constant"
   
}
 
}
}

layers
{
  name
: "relu3"
  type
:RELU
  bottom
:"conv3"
  top
: "conv3"
}

layers
{
  name
: "pool3"
  type
:POOLING
  bottom
: "conv3"
  top
: "pool3"
  pooling_param
{
    pool
: MAX
    kernel_size
: 2
    stride
: 2
 
}
}



layers
{
  name
: "ip1"
  type
: INNER_PRODUCT
  bottom
: "pool3"
  top
: "ip1"
  blobs_lr
:1
  blobs_lr
:2
  inner_product_param
{
    num_output
: 500
    weight_filler
{
      type
:"gaussian"
      std
:0.1
   
}
    bias_filler
{
      type
: "constant"
   
}
 
}
}

layers
{
  name
: "relu4"
  type
: RELU
  bottom
:"ip1"
  top
:"ip1"
}

layers
{
  name
: "ip2"
  type
: INNER_PRODUCT
  bottom
: "ip1"
  top
: "ip2"
  blobs_lr
:1
  blobs_lr
:2
  inner_product_param
{
    num_output
: 500
    weight_filler
{
      type
:"gaussian"
      std
: 0.1
   
}
    bias_filler
{
      type
: "constant"
   
}
 
}
}

layers
{
  name
:"relu5"
  type
:RELU
  bottom
:"ip2"
  top
: "ip2"
}

layers
{
  name
: "ip3"
  type
: INNER_PRODUCT
  bottom
: "ip2"
  top
: "ip3"
  blobs_lr
: 1
  blobs_lr
: 2
  inner_product_param
{
    num_output
: 30
    weight_filler
{
      type
:"gaussian"
      std
:0.3
   
}
    bias_filler
{
      type
: "constant"
   
}
 
}
}

layers
{
  name
: "loss"
  type
: EUCLIDEAN_LOSS
  bottom
:"ip3"
  bottom
:"label"
}


but the loss is INF,  have anybody do it before, or any help, thx

Grigory V.Sapunov

unread,
Feb 4, 2015, 5:15:13 AM2/4/15
to dong sui, caffe...@googlegroups.com
Did you try to recude learning rate?

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/1504e37c-6831-4fa1-83a0-1c2f5711a7d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wei Guo

unread,
Feb 6, 2015, 12:40:19 AM2/6/15
to caffe...@googlegroups.com
Hi,Dong:
        how to do convert the dataset including labels(facial features) to HDF5 format? Woulnd you mind send me the converted dataset?

Thank

wei guo                  

LINGHAO ZHU

unread,
Feb 9, 2015, 2:04:19 AM2/9/15
to caffe...@googlegroups.com
Hi,

May I ask how did you convert the dataset with labels (coordinates of the keypoints?) and how to output the coordinates, as a long vector or else?

Thanks!



在 2015年2月1日星期日 UTC+8下午4:50:05,dong sui写道:
...

Idris Y

unread,
Feb 9, 2015, 8:39:29 AM2/9/15
to caffe...@googlegroups.com
Also try to decrease std in weight_filler.

воскресенье, 1 февраля 2015 г., 13:50:05 UTC+5 пользователь dong sui написал:

Prabhu

unread,
Feb 10, 2015, 2:08:07 PM2/10/15
to caffe...@googlegroups.com
You can dump numpy array to hd5 file using python (very easy)
see: http://www.h5py.org/

P.S: I am also working on facial keypoints problem and almost there on last stage. Feel free to contact me.

wusong...@gmail.com

unread,
Dec 8, 2015, 4:51:16 AM12/8/15
to Caffe Users

Hi, all,
I want to implement the code from the paper "Deep convolutional network cascade for facial point detection". I tried to redo the first level in this paper, but failed to train the network. The attached is my code, and the dataset is from the website: http://mmlab.ie.cuhk.edu.hk/archive/CNN_FacePoint.htm. And could someone give me some suggestions about my code?
Thanks in advance!
Song.
code.tar.gz

wusong...@gmail.com

unread,
Dec 8, 2015, 4:53:40 AM12/8/15
to Caffe Users
Hi, all,
I want to implement the code from the paper "Deep convolutional network cascade for facial point detection". I tried to redo the first level in this paper, but failed to train the network. The attached is my code, and the dataset is from the website: http://mmlab.ie.cuhk.edu.hk/archive/CNN_FacePoint.htm. And could someone give me some suggestions about my code?
Thanks in advance!
Song.

On Tuesday, February 10, 2015 at 8:08:07 PM UTC+1, Prabhu wrote:
code.tar.gz

wusong...@gmail.com

unread,
Dec 8, 2015, 4:55:35 AM12/8/15
to Caffe Users
Hi, all,
I want to implement the code from the paper "Deep convolutional network cascade for facial point detection". I tried to redo the first level in this paper, but failed to train the network. The attached is my code, and the dataset is from the website: http://mmlab.ie.cuhk.edu.hk/archive/CNN_FacePoint.htm. And could someone give me some suggestions about my code?
Thanks in advance!
Song.

On Tuesday, February 10, 2015 at 8:08:07 PM UTC+1, Prabhu wrote:
code.tar.gz
Reply all
Reply to author
Forward
0 new messages