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类的。敬请期待!





### 回答1: 您可以通过以下步骤安装Deep Learning Toolbox Model for ResNet-50 Network和Deep Learning Toolbox Model for Inception-v3 Network: 1. 打开MATLAB软件并进入主界面。 2. 点击“Add-Ons”选项卡,然后选择“Get Add-Ons”。 3. 在搜索栏中输入“Deep Learning Toolbox Model for ResNet-50 Network”或“Deep Learning Toolbox Model for Inception-v3 Network”。 4. 点击“Install”按钮,等待安装完成。 5. 安装完成后,您可以在MATLAB中使用这些模型进行深度学习任务。 希望这个回答对您有所帮助! ### 回答2: 安装MATLAB中的Deep Learning Toolbox Model for ResNet-50 Network和Deep Learning Toolbox Model for Inception-v3 Network是非常简单的。 首先,确保你已经安装了MATLAB软件,并具有有效的许可证。 然后,打开MATLAB软件,点击工具栏上的“Add-Ons”按钮,它位于主界面的右上角。 在弹出的界面中,点击左侧的“Get Add-Ons”选项卡。 在搜索框中,输入"Deep Learning Toolbox Model for ResNet-50 Network"并点击搜索按钮。 在搜索结果中找到对应的模型,点击右侧的"Add From GitHub"按钮。 稍等几秒钟,MATLAB会自动下载并安装所需的模型。 重复以上步骤,以同样的方式安装“Deep Learning Toolbox Model for Inception-v3 Network”。 安装完成后,你可以在MATLAB的命令窗口中使用这些模型。例如,你可以通过以下命令加载已安装的ResNet-50模型: ```matlab net = resnet50; ``` 或者加载已安装的Inception-v3模型: ```matlab net = inceptionv3; ``` 这样就可以使用这些预训练的深度学习模型进行各种任务,如图像分类、目标检测等。记得在使用这些模型之前,先要明确自己的目标并适当调整模型以适应任务要求。 ### 回答3: 要安装Matlab中的Deep Learning Toolbox Model for ResNet-50 Network和Deep Learning Toolbox Model for Inception-v3 Network,您可以按照以下步骤进行操作: 1. 首先,确保您已经安装了Deep Learning Toolbox和Matlab软件。这些工具是使用这些深度学习模型的前提条件。 2. 打开Matlab软件,在主界面的"HOME"选项卡下,选择"Get Add-Ons"。这将打开Matlab Add-On Explorer。 3. 在搜索框中输入"Deep Learning Toolbox Model for ResNet-50 Network",然后点击搜索按钮。 4. 在搜索结果中找到"Deep Learning Toolbox Model for ResNet-50 Network",然后点击"Add"按钮进行安装。等待安装过程完成。 5. 重复步骤3和步骤4,这一次搜索"Deep Learning Toolbox Model for Inception-v3 Network",然后点击"Add"按钮进行安装。同样,等待安装过程完成。 6. 安装完成后,您可以在Matlab的工具箱中找到这些深度学习模型。打开"APPS"选项卡,在"Deep Learning Toolbox"部分下,您会看到"ResNet-50"和"Inception-v3"模型。 7. 单击所需的模型,Matlab将加载相应的模型并打开一个图形用户界面。 8. 在这个界面上,您可以使用这些预训练模型进行不同的深度学习任务,如图像分类、特征提取等。 请注意,这些模型的安装过程可能会因您的Matlab版本和操作系统而有所不同。确保您的Matlab版本兼容并满足相应的系统要求。此外,确保您的计算机具有足够的计算资源来运行这些深度学习模型。
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值