深度学习入门:Simultaneous Feature Learning and Hash Coding with Deep Neural Networks

             Simultaneous Feature Learning 

         and Hash Coding with Deep Neural Networks


  这篇paper也是和深度hash相关的,该论文分为三个部分,如下图所示:输入的image这里使用的是三个输入图像,有两个图想属于同一个class,另一个图像和属于另一个class。在试验部分,作者让三个image使用相同的一个网络(当然,还可以让queries使用一个net,而similar images和dissimilar images共享一个Net)达到了比较好的效果。中间一些列的卷积层其实是network-in-network的一个改变版本:在每一个卷积层的后面插入一个1*1的卷积核作为一个线性的转换器,把fc层改为average pooling,最终的输出feature map大小是50*#bits*1*1。简单点而看下面的divide-and-encode中有n个bits,每个bits中有50个神经元,然后这50个神经元在concatenate成为一个神经元,这样50*bits*1*1就变成了bits*1*1*1,也就是bits个神经元,然后使用的triple loss进行参数学习。


   

     最后得到的50个神经元在经过一个piece-wise 阈值函数如下:



 中间的网络架构如下:


 divide-and-encode 的caffe版本实现如下:(如有错误,请不吝赐教)

layer{
  name: "pool4"
  type: "Pooling"
  bottom: "conv4_1"
  top: "pool4"
  pooling_param{
    pool: AVERAGE
    kernel_size: 3
    stride: 2
  }
}


layer{
  name: "spilt"
  type: "Slice"
  bottom: "pool4"
  top: "slice_1"
  top: "slice_2"
  top: "slice_3"
  top: "slice_4"
  slice_param{
    slice_dim:1
    slice_point:50
    slice_point:100
    slice_point:150
  }
}

layer {
  name: "ip_1"
  type: "InnerProduct"
  bottom: "slice_1"
  top: "hash_1"
  inner_product_param {
    num_output: 1
  }
}

layer {
  name: "ip_2"
  type: "InnerProduct"
  bottom: "slice_2"
  top: "hash_2"
  inner_product_param {
    num_output: 1
  }
}

layer {
  name: "ip_3"
  type: "InnerProduct"
  bottom: "slice_3"
  top: "hash_3"
  inner_product_param {
    num_output: 1
  }
}

layer {
  name: "ip_4"
  type: "InnerProduct"
  bottom: "slice_4"
  top: "hash_4"
  inner_product_param {
    num_output: 1
  }
}

layer {
  name: "concat"
  type: "Concat"
  bottom: "hash_1"
  bottom: "hash_2"
  bottom: "hash_3"
  bottom: "hash_4"
  top: "concat"
  concat_param {
    concat_dim: 1
  }
}

layer {
  name: "triplet"
  type: "Slice"
  bottom: "concat"
  top: "query"
  top: "positive"
  top: "negetive"
  slice_param {
    axis: 0
    slice_point: 16
    slice_point: 32
  }
}

layer {
  name: "pos_sim"
  type: "DotProductSimilarity"
  bottom: "query"
  bottom: "positive"
  top: "pos_sim"
}
layer {
  name: "neg_sim"
  type: "DotProductSimilarity"
  bottom: "query"
  bottom: "negetive"
  top: "neg_sim"
}
layer {
  name: "loss"
  type: "PairwiseRankingLoss"
  bottom: "pos_sim"
  bottom: "neg_sim"
  top: "loss"
  triplet_loss_param {
    margin: 1
  }
}






  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值