けの〜のブログ

ガッキーでディープラーニングして教育界に革命を起こす

学習を上手く行うために data preprocessingについて

特に画像データに関してはzero-centeringの処理のみ行う

f:id:keno-lasalle-kagoshima:20171117164952p:plain

 

機械学習においてそれぞれの特徴量が同じように影響し合う(元々の数値の大きさに左右されないために)正規化という処理を施すが、画像データでは行わない。

 

それは隣り合うピクセルは相対的な違いを表しており、大きさ、分散がそこまで大きく異ならないためだ。

 

どのようにzero-centerを行うかは異なる
学習データの32×32×3のpixelから平均を計算するか(Alexnetで使われている)

RGBのchannelごとに平均を計算するか(VGGnetなどで使われている)

 

In practice. We mention PCA/Whitening in these notes for completeness, but these transformations are not used with Convolutional Networks. However, it is very important to zero-center the data, and it is common to see normalization of every pixel as well.

Common pitfall. An important point to make about the preprocessing is that any preprocessing statistics (e.g. the data mean) must only be computed on the training data, and then applied to the validation / test data. E.g. computing the mean and subtracting it from every image across the entire dataset and then splitting the data into train/val/test splits would be a mistake. Instead, the mean must be computed only over the training data and then subtracted equally from all splits (train/val/test).

気をつけなければならないのが、preprocessing、前処理をする際に基準とするものはtrain dataから導き、そして処理をtrain/validation/test dataに適用する必要がある、ということ。

cs231n.github.io