LoginSignup
1
0

Auto Encoderの特徴抽出(色付きMNIST)

Posted at

AEの学習には基本的に下記のリンクに書いてあります。

tensorflowを用いてAuto Encoderの特徴抽出の実装(MNIST)

今回は上記の実験に比較して、MNISTのデータを変更して学習した結果を示します。

MNISTをランダムでRGBの色ごとに着色していきます

(X, y) , (test_images, test_labels) = tensorflow.keras.datasets.mnist.load_data()
#(X.shape) (y.shape)  (60000, 28, 28) (60000,)

label=np.random.randint(0,3,(X.shape[0])) 
choice_color=[np.identity(3)[i] for i in label] 
choice_color=np.array(choice_color)
#(choice_color.shape)(60000, 3)
Color_MNIST= [MNIST_3[i]*choice_color[i]  for i in range(X.shape[0])]
Color_MNIST=np.array(Color_MNIST)
#(Color_MNIST.shape) (60000, 28, 28, 3)

通常のMNIST

ダウンロード - 2023-06-01T145819.762.png

RGB_MNIST

ダウンロード - 2023-06-01T145752.940.png

RGBに着色した、MNISTのデータセットができました。
それをAEで学習を行います。

実験結果

形状ごと

ダウンロード - 2023-06-01T145124.394.png

色ごと

ダウンロード - 2023-06-01T145128.408.png

プロット

ダウンロード - 2023-06-01T145132.420.png

結論

色の情報を優先して特徴を抽出していることが確認ができた。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0