deep learning实践经验总结2--准确率再次提升,到达0.8,再来总结一下

deep learning实践经验总结2

最近拿caffe来做图片分类,遇到不少问题,同时也吸取不少教训和获得不少经验。

这次拿大摆裙和一步裙做分类,

多次训练效果一直在0.7,后来改动了全链接层的初始化参数。高斯分布的标准差由0.001改为0.0001,就是调小了。

然后效果很明显,准确率高了,权重图画出来后,也看得出是有意义的了,部分权重图是人的轮廓或者裙子的轮廓。

先看看图片:

大摆裙

    

一步裙

    

然后找一些响应图看一下,当然我这里展示的是一些效果好的响应图。

大摆裙

   
 

一步裙

   
 

一些权重图:

    

    

    

这是网络的结构参数:

name: "CIFAR10_full_train"
layers {
 layer {
   name: "cifar"
   type: "data"
   #source: "/home/linger/linger/testfile/crop_train_db"
   #source: "/home/linger/linger/testfile/collar_train_db"
   source: "/home/linger/linger/testfile/skirt_train_db"
   #source: "/home/linger/linger/testfile/pattern_train_db"
   meanfile: "/home/linger/linger/testfile/skirt_train_mean.binaryproto"
   #cropsize: 200
   batchsize: 20
 }
 top: "data"
 top: "label"
}

layers {
  layer {
    name: "conv1"
    type: "conv"
    num_output: 16
    kernelsize: 5
    stride:1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
      value: 0.
    }
    blobs_lr: 1.
    blobs_lr: 1.
    weight_decay: 0.001
    weight_decay: 0.
  }
  bottom: "data"
  top: "conv1"
}
layers {
  layer {
    name: "relu1"
    type: "relu"
  }
  bottom: "conv1"
  top: "conv1"
}
layers {
  layer {
    name: "pool1"
    type: "pool"
    pool: MAX
    kernelsize: 2
    stride:1
  }
  bottom: "conv1"
  top: "pool1"
}
layers {
  layer {
    name: "conv2"
    type: "conv"
    num_output: 16
    group: 2
    kernelsize: 5
    stride:1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
      value: 0.
    }
    blobs_lr: 1.
    blobs_lr: 1.
    weight_decay: 0.001
    weight_decay: 0.
  }
  bottom: "pool1"
  top: "conv2"
}
layers {
  layer {
    name: "relu2"
    type: "relu"
  }
  bottom: "conv2"
  top: "conv2"
}
layers {
  layer {
    name: "pool2"
    type: "pool"
    pool: MAX
    kernelsize: 2
    stride: 1
  }
  bottom: "conv2"
  top: "pool2"
}

layers {
  layer {
    name: "ip1"
    type: "innerproduct"
    num_output: 100
    weight_filler {
      type: "gaussian"
      std: 0.0001
    }
    bias_filler {
      type: "constant"
      value: 0.
    }
    blobs_lr: 1.
    blobs_lr: 1.
    weight_decay: 0.001
    weight_decay: 0.
  }
  bottom: "pool2"
  top: "ip1"
}

layers {
  layer {
    name: "ip2"
    type: "innerproduct"
    num_output: 2
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
      value: 0.
    }
    blobs_lr: 1.
    blobs_lr: 1.
    weight_decay: 0.001
    weight_decay: 0.
  }
  bottom: "ip1"
  top: "ip2"
}

#-----------------------output------------------------
layers {
 layer {
   name: "loss"
   type: "softmax_loss"
 }
 bottom: "ip2"
 bottom: "label"
}
name: "CIFAR10_full_test"
layers {
 layer {
   name: "cifar"
   type: "data"
   #source: "/home/linger/linger/testfile/collar_test_db"
   #source: "/home/linger/linger/testfile/crop_test_db"
   source: "/home/linger/linger/testfile/skirt_test_db"
   #source: "/home/linger/linger/testfile/pattern_test_db"
   meanfile: "/home/linger/linger/testfile/skirt_test_mean.binaryproto"
   #cropsize: 200
   batchsize: 10
 }
 top: "data"
 top: "label"
}

layers {
  layer {
    name: "conv1"
    type: "conv"
    num_output: 16
    kernelsize: 5
    stride:1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
      value: 0.
    }
    blobs_lr: 1.
    blobs_lr: 1.
    weight_decay: 0.001
    weight_decay: 0.
  }
  bottom: "data"
  top: "conv1"
}
layers {
  layer {
    name: "relu1"
    type: "relu"
  }
  bottom: "conv1"
  top: "conv1"
}
layers {
  layer {
    name: "pool1"
    type: "pool"
    pool: MAX
    kernelsize: 2
    stride:1
  }
  bottom: "conv1"
  top: "pool1"
}
layers {
  layer {
    name: "conv2"
    type: "conv"
    num_output: 16
    group: 2
    kernelsize: 5
    stride:1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
      value: 0.
    }
    blobs_lr: 1.
    blobs_lr: 1.
    weight_decay: 0.001
    weight_decay: 0.
  }
  bottom: "pool1"
  top: "conv2"
}
layers {
  layer {
    name: "relu2"
    type: "relu"
  }
  bottom: "conv2"
  top: "conv2"
}
layers {
  layer {
    name: "pool2"
    type: "pool"
    pool: MAX
    kernelsize: 2
    stride: 1
  }
  bottom: "conv2"
  top: "pool2"
}
layers {
  layer {
    name: "ip1"
    type: "innerproduct"
    num_output: 100
    weight_filler {
      type: "gaussian"
      std: 0.0001
    }
    bias_filler {
      type: "constant"
      value: 0.
    }
    blobs_lr: 1.
    blobs_lr: 1.
    weight_decay: 0.001
    weight_decay: 0.
  }
  bottom: "pool2"
  top: "ip1"
}

layers {
  layer {
    name: "ip2"
    type: "innerproduct"
    num_output: 2
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
      value: 0.
    }
    blobs_lr: 1.
    blobs_lr: 1.
    weight_decay: 0.001
    weight_decay: 0.
  }
  bottom: "ip1"
  top: "ip2"
}

#-----------------------output------------------------
layers {
 layer {
   name: "prob"
   type: "softmax"
 }
 bottom: "ip2"
 top: "prob"
}
layers {
  layer {
    name: "accuracy"
    type: "accuracy"
  }
  bottom: "prob"
  bottom: "label"
  top: "accuracy"
}
# reduce learning rate after 120 epochs (60000 iters) by factor 0f 10
# then another factor of 10 after 10 more epochs (5000 iters)

# The training protocol buffer definition
train_net: "cifar10_full_train.prototxt"
# The testing protocol buffer definition
test_net: "cifar10_full_test.prototxt"
# test_iter specifies how many forward passes the test should carry out.
# In the case of CIFAR10, we have test batch size 100 and 100 test iterations,
# covering the full 10,000 testing images.
test_iter: 20
# Carry out testing every 1000 training iterations.
test_interval: 100
# The base learning rate, momentum and the weight decay of the network.
base_lr: 0.00001
momentum: 0.9
weight_decay: 0.004
# The learning rate policy
lr_policy: "fixed"
# Display every 200 iterations
display: 20
# The maximum number of iterations
max_iter: 60000
# snapshot intermediate results
snapshot: 1000
snapshot_prefix: "cifar10_full"
# solver mode: 0 for CPU and 1 for GPU
solver_mode: 1

真的是多玩数据,才会对数据形成一种感觉啊。

下次玩3类的。敬请期待!

deep learning实践经验总结2--准确率再次提升,到达0.8,再来总结一下

时间: 2024-08-29 17:41:15

deep learning实践经验总结2--准确率再次提升,到达0.8,再来总结一下的相关文章

deep learning实践经验总结

近期拿caffe来做图片分类.遇到不少问题,同一时候也吸取不少教训和获得不少经验. 先看样例再总结经验. 这是一个2类分类器.分的是条纹衣服和纯色衣服. 先看几张图片. 条纹衣服:   纯色衣服: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbGluZ2VybGFubGFu/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" > 肉眼也非常eas

TensorFlow和深度学习新手教程(TensorFlow and deep learning without a PhD)

前言 上月导师在组会上交我们用tensorflow写深度学习和卷积神经网络.并把其PPT的參考学习资料给了我们, 这是codelabs上的教程:<TensorFlow and deep learning,without a PhD> 当然登入须要FQ,我也顺带巩固下,做个翻译.不好之处请包括指正. 当然须要安装python,教程推荐使用python3.假设是Mac,能够參考博主的另外两片博文,Mac下升级python2.7到python3.6, Mac安装tensorflow1.0 好多专业词

Deep Learning(深度学习)学习笔记整理

申明:本文非笔者原创,原文转载自:http://www.sigvc.org/bbs/thread-2187-1-3.html 4.2.初级(浅层)特征表示 既然像素级的特征表示方法没有作用,那怎样的表示才有用呢? 1995 年前后,Bruno Olshausen和 David Field 两位学者任职 Cornell University,他们试图同时用生理学和计算机的手段,双管齐下,研究视觉问题. 他们收集了很多黑白风景照片,从这些照片中,提取出400个小碎片,每个照片碎片的尺寸均为 16x1

TensorFlow和深度学习入门教程(TensorFlow and deep learning without a PhD)

前言 上月导师在组会上交我们用tensorflow写深度学习和卷积神经网络,并把其PPT的参考学习资料给了我们, 这是codelabs上的教程:<TensorFlow and deep learning,without a PhD> 当然登入需要翻墙,我也顺带巩固下,做个翻译,不好之处请包含指正. 当然需要安装python,教程推荐使用python3.如果是Mac,可以参考博主的另外两片博文,Mac下升级python2.7到python3.6, Mac安装tensorflow1.0 好多专业词

Deep Learning in NLP (一)词向量和语言模型

Deep Learning in NLP (一)词向量和语言模型 这篇博客是我看了半年的论文后,自己对 Deep Learning 在 NLP 领域中应用的理解和总结,在此分享.其中必然有局限性,欢迎各种交流,随便拍. Deep Learning 算法已经在图像和音频领域取得了惊人的成果,但是在 NLP 领域中尚未见到如此激动人心的结果.关于这个原因,引一条我比较赞同的微博. @王威廉:Steve Renals算了一下icassp录取文章题目中包含deep learning的数量,发现有44篇,

Deep Learning(深度学习)学习笔记整理系列 | @Get社区

body { font-family: Microsoft YaHei UI,"Microsoft YaHei", Georgia,Helvetica,Arial,sans-serif,宋体, PMingLiU,serif; font-size: 10.5pt; line-height: 1.5; } html, body { } h1 { font-size:1.5em; font-weight:bold; } h2 { font-size:1.4em; font-weight:bo

【深度学习Deep Learning】资料大全

转载:http://www.cnblogs.com/charlotte77/p/5485438.html 最近在学深度学习相关的东西,在网上搜集到了一些不错的资料,现在汇总一下: Free Online Books Deep Learning66 by Yoshua Bengio, Ian Goodfellow and Aaron Courville Neural Networks and Deep Learning42 by Michael Nielsen Deep Learning27 by

(转)大牛的《深度学习》笔记,60分钟带你学会Deep Learning。

大牛的<深度学习>笔记,60分钟带你学会Deep Learning. 2016-08-01 Zouxy 阅面科技 上期:<从特征描述到深度学习:计算机视觉发展20年> 回复“01”回顾全文   本期:大牛的<深度学习>笔记,60分钟带你学会Deep Learning. 深度学习,即Deep Learning,是一种学习算法(Learning algorithm),亦是人工智能领域的一个重要分支.从快速发展到实际应用,短短几年时间里,深度学习颠覆了语音识别.图像分类.文本

Word2Vec之Deep Learning in NLP (一)词向量和语言模型

转自licstar,真心觉得不错,可惜自己有些东西没有看懂 这篇博客是我看了半年的论文后,自己对 Deep Learning 在 NLP 领域中应用的理解和总结,在此分享.其中必然有局限性,欢迎各种交流,随便拍. Deep Learning 算法已经在图像和音频领域取得了惊人的成果,但是在 NLP 领域中尚未见到如此激动人心的结果.关于这个原因,引一条我比较赞同的微博. @王威廉:Steve Renals算了一下icassp录取文章题目中包含deep learning的数量,发现有44篇,而na