質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Caffe

Caffeは、深層学習に用いられるオープンソースフレームワークの一つです。C++で実装されており、C++/Python/MATLABで用いることができます。画像認識に特化しており、動作も早い点が特徴。GUPにも対応しています。

機械学習

機械学習は、データからパターンを自動的に発見し、そこから知能的な判断を下すためのコンピューターアルゴリズムを指します。人工知能における課題のひとつです。

Q&A

0回答

411閲覧

Caffe学習時のAccuracyと画像を入力した時の正解率の違い

satoUmino

総合スコア19

Caffe

Caffeは、深層学習に用いられるオープンソースフレームワークの一つです。C++で実装されており、C++/Python/MATLABで用いることができます。画像認識に特化しており、動作も早い点が特徴。GUPにも対応しています。

機械学習

機械学習は、データからパターンを自動的に発見し、そこから知能的な判断を下すためのコンピューターアルゴリズムを指します。人工知能における課題のひとつです。

0グッド

0クリップ

投稿2019/10/28 06:18

現在、私はCaffeを用いて画像識別を行うための分類器の作成を行っています。
以下記載のtrain.prototxtを用いて
のコマンドにて学習を行いました。
この時に表示されるaccuracyとlossを記録し、実際に学習を行ったCaffeモデルに学習をした画像300枚を入力した時の正答率と比べたのですが一致しません。
train.prototxtで得られるAccuracyと画像を入力した時の正解率とでは違うのでしょうか?
出た値は、学習時のものは0.9程度で実際に学習を終えたものに入力した場合は0.6~0.7程度の結果となりました。

簡単な質問かもしれませんがよろしくお願いします。
train.prototxt
layer {
name: "data" type: "Data" top: "data" top: "label"
include { phase: TRAIN }
transform_param {
mirror: true
mean_file: "mean.binaryproto"
}
data_param {
source: "train_lmdb"
batch_size: 256
backend: LMDB
}
}
layer {
name: "data" type: "Data" top: "data" top: "label"
include { phase: TEST }
transform_param {
mirror: false
mean_file: "mean.binaryproto"
}
data_param {
source: "val_lmdb"
batch_size: 20
backend: LMDB
}
}
layer {
name: "conv1" type: "Convolution" bottom: "data" top: "conv1"
param { lr_mult: 1 decay_mult: 1 }
param { lr_mult: 2 decay_mult: 0 }
convolution_param {
num_output: 96 kernel_size: 11 stride: 4
weight_filler { type: "gaussian" std: 0.01 }
bias_filler { type: "constant" value: 0 }
}
}
layer { name: "relu1" type: "ReLU" bottom: "conv1" top: "conv1" }
layer {
name: "norm1" type: "LRN" bottom: "conv1" top: "norm1"
lrn_param { local_size: 5 alpha: 0.0001 beta: 0.75 }
}
layer {
name: "pool1" type: "Pooling" bottom: "norm1" top: "pool1"
pooling_param { pool: MAX kernel_size: 3 stride: 2 }
}
layer {
name: "conv2" type: "Convolution" bottom: "pool1" top: "conv2"
param { lr_mult: 1 decay_mult: 1 }
param { lr_mult: 2 decay_mult: 0 }
convolution_param {
num_output: 256 pad: 2 kernel_size: 5 group: 2
weight_filler { type: "gaussian" std: 0.01 }
bias_filler { type: "constant" value: 0.1 }
}
}
layer { name: "relu2" type: "ReLU" bottom: "conv2" top: "conv2" }
layer {
name: "norm2" type: "LRN" bottom: "conv2" top: "norm2"
lrn_param { local_size: 5 alpha: 0.0001 beta: 0.75 }
}
layer {
name: "pool2" type: "Pooling" bottom: "norm2" top: "pool2"
pooling_param { pool: MAX kernel_size: 3 stride: 2 }
}
layer {
name: "conv3" type: "Convolution" bottom: "pool2" top: "conv3"
param { lr_mult: 1 decay_mult: 1 }
param { lr_mult: 2 decay_mult: 0 }
convolution_param { num_output: 384 pad: 1 kernel_size: 3
weight_filler { type: "gaussian" std: 0.01 }
bias_filler { type: "constant" value: 0 }
}
}
layer { name: "relu3" type: "ReLU" bottom: "conv3" top: "conv3" }
layer {
name: "conv4" type: "Convolution" bottom: "conv3" top: "conv4"
param { lr_mult: 1 decay_mult: 1 }
param { lr_mult: 2 decay_mult: 0 }
convolution_param {
num_output: 384 pad: 1 kernel_size: 3 group: 2
weight_filler { type: "gaussian" std: 0.01 }
bias_filler { type: "constant" value: 0.1 }
}
}
layer { name: "relu4" type: "ReLU" bottom: "conv4" top: "conv4" }
layer {
name: "conv5" type: "Convolution" bottom: "conv4" top: "conv5"
param { lr_mult: 1 decay_mult: 1 }
param { lr_mult: 2 decay_mult: 0 }
convolution_param {
num_output: 256 pad: 1 kernel_size: 3 group: 2
weight_filler { type: "gaussian" std: 0.01 }
bias_filler { type: "constant" value: 0.1 }
}
}
layer { name: "relu5" type: "ReLU" bottom: "conv5" top: "conv5" }
layer {
name: "pool5" type: "Pooling" bottom: "conv5" top: "pool5"
pooling_param { pool: MAX kernel_size: 3 stride: 2 }
}
layer {
name: "fc6-ft" type: "InnerProduct" bottom: "pool5" top: "fc6"
param { lr_mult: 1 decay_mult: 1 }
param { lr_mult: 2 decay_mult: 0 }
inner_product_param { num_output: 4096
weight_filler { type: "gaussian" std: 0.005 }
bias_filler { type: "constant" value: 0.1 }
}
}
layer { name: "relu6" type: "ReLU" bottom: "fc6" top: "fc6" }
layer {
name: "drop6" type: "Dropout" bottom: "fc6" top: "fc6"
dropout_param { dropout_ratio: 0.5 }
}
layer {
name: "fc7-ft" type: "InnerProduct" bottom: "fc6" top: "fc7"
param { lr_mult: 1 decay_mult: 1 }
param { lr_mult: 2 decay_mult: 0 }
inner_product_param { num_output: 4096
weight_filler { type: "gaussian" std: 0.005 }
bias_filler { type: "constant" value: 0.1 }
}
}
layer { name: "relu7" type: "ReLU" bottom: "fc7" top: "fc7" }
layer { name: "drop7" type: "Dropout" bottom: "fc7" top: "fc7"
dropout_param { dropout_ratio: 0.5 }
}
layer {
name: "fc8-ft" type: "InnerProduct" bottom: "fc7" top: "fc8"
param { lr_mult: 1 decay_mult: 1 }
param { lr_mult: 2 decay_mult: 0 }
inner_product_param { num_output: 4
weight_filler { type: "gaussian" std: 0.01 }
bias_filler { type: "constant" value: 0 }
}
}
layer {
name: "accuracy" type: "Accuracy"
bottom: "fc8" bottom: "label" top: "accuracy"
include { phase: TEST }
}
layer {
name: "loss" type: "SoftmaxWithLoss"
bottom: "fc8" bottom: "label" top: "loss"
}
caffe train --solver=prototxt/solver.prototxt

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問