Uncertainty estimation in deep learning using monte carlo dropout with keras.
In this sample, estimate uncertainty in CNN classification of dogs and cats images using monte carlo dropout.
I examined CNN using sigmoid and softmax. Some of the results are shown below. Note that P(dog) is the probability of being a dog.
fig. [CNN using sigmoid] std of predicted P(dog) vs predicted P(dog) when using a dog image for input.
fig. [CNN using sigmoid] std of predicted P(dog) vs predicted P(dog) when using a cat image for input.
fig. [CNN using softmax] std of predicted P(dog) vs predicted P(dog) when using a dog image for input.
fig. [CNN using softmax] std of predicted P(dog) vs predicted P(dog) when using a cat image for input.
The details are described in the blog below.
https://st1990.hatenablog.com/entry/2019/07/31/010010
MC DropoutでのDLの不確かさ評価(keras)。
このサンプルでは、犬猫画像のCNNでの分類の不確かさを評価する。
詳細は以下のブログ参照。
https://st1990.hatenablog.com/entry/2019/07/31/010010
犬猫分類の不確かさを評価する。
kerasモデルを推論時にdropoutを使えるモデルに変換する。
dropoutとL2正則化を使った二値分類CNNを作成する。
cifar10のデータを扱う。