Hello!Projectのメンバーのアメブロから収集した画像を、MediaPipeのBlazeFaceで顔検出&切り出しを行い、VGGFace2で学習させたFaceNetを用いて特徴量を抽出して、マンハッタン距離でtopKアルゴリズムで分類したものです。
2023-01-15 12:13:58.165751.h5の中身(model.summary())
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_1 (InputLayer) [(None, 224, 224, 3 0 []
)]
conv1/7x7_s2 (Conv2D) (None, 112, 112, 64 9408 ['input_1[0][0]']
)
conv1/7x7_s2/bn (BatchNormaliz (None, 112, 112, 64 256 ['conv1/7x7_s2[0][0]']
ation) )
activation (Activation) (None, 112, 112, 64 0 ['conv1/7x7_s2/bn[0][0]']
)
max_pooling2d (MaxPooling2D) (None, 55, 55, 64) 0 ['activation[0][0]']
conv2_1_1x1_reduce (Conv2D) (None, 55, 55, 64) 4096 ['max_pooling2d[0][0]']
conv2_1_1x1_reduce/bn (BatchNo (None, 55, 55, 64) 256 ['conv2_1_1x1_reduce[0][0]']
rmalization)
activation_1 (Activation) (None, 55, 55, 64) 0 ['conv2_1_1x1_reduce/bn[0][0]']
conv2_1_3x3 (Conv2D) (None, 55, 55, 64) 36864 ['activation_1[0][0]']
conv2_1_3x3/bn (BatchNormaliza (None, 55, 55, 64) 256 ['conv2_1_3x3[0][0]']
tion)
activation_2 (Activation) (None, 55, 55, 64) 0 ['conv2_1_3x3/bn[0][0]']
conv2_1_1x1_increase (Conv2D) (None, 55, 55, 256) 16384 ['activation_2[0][0]']
conv2_1_1x1_proj (Conv2D) (None, 55, 55, 256) 16384 ['max_pooling2d[0][0]']
conv2_1_1x1_increase/bn (Batch (None, 55, 55, 256) 1024 ['conv2_1_1x1_increase[0][0]']
Normalization)
conv2_1_1x1_proj/bn (BatchNorm (None, 55, 55, 256) 1024 ['conv2_1_1x1_proj[0][0]']
alization)
add (Add) (None, 55, 55, 256) 0 ['conv2_1_1x1_increase/bn[0][0]',
'conv2_1_1x1_proj/bn[0][0]']
activation_3 (Activation) (None, 55, 55, 256) 0 ['add[0][0]']
conv2_2_1x1_reduce (Conv2D) (None, 55, 55, 64) 16384 ['activation_3[0][0]']
conv2_2_1x1_reduce/bn (BatchNo (None, 55, 55, 64) 256 ['conv2_2_1x1_reduce[0][0]']
rmalization)
activation_4 (Activation) (None, 55, 55, 64) 0 ['conv2_2_1x1_reduce/bn[0][0]']
conv2_2_3x3 (Conv2D) (None, 55, 55, 64) 36864 ['activation_4[0][0]']
conv2_2_3x3/bn (BatchNormaliza (None, 55, 55, 64) 256 ['conv2_2_3x3[0][0]']
tion)
activation_5 (Activation) (None, 55, 55, 64) 0 ['conv2_2_3x3/bn[0][0]']
conv2_2_1x1_increase (Conv2D) (None, 55, 55, 256) 16384 ['activation_5[0][0]']
conv2_2_1x1_increase/bn (Batch (None, 55, 55, 256) 1024 ['conv2_2_1x1_increase[0][0]']
Normalization)
add_1 (Add) (None, 55, 55, 256) 0 ['conv2_2_1x1_increase/bn[0][0]',
'activation_3[0][0]']
activation_6 (Activation) (None, 55, 55, 256) 0 ['add_1[0][0]']
conv2_3_1x1_reduce (Conv2D) (None, 55, 55, 64) 16384 ['activation_6[0][0]']
conv2_3_1x1_reduce/bn (BatchNo (None, 55, 55, 64) 256 ['conv2_3_1x1_reduce[0][0]']
rmalization)
activation_7 (Activation) (None, 55, 55, 64) 0 ['conv2_3_1x1_reduce/bn[0][0]']
conv2_3_3x3 (Conv2D) (None, 55, 55, 64) 36864 ['activation_7[0][0]']
conv2_3_3x3/bn (BatchNormaliza (None, 55, 55, 64) 256 ['conv2_3_3x3[0][0]']
tion)
activation_8 (Activation) (None, 55, 55, 64) 0 ['conv2_3_3x3/bn[0][0]']
conv2_3_1x1_increase (Conv2D) (None, 55, 55, 256) 16384 ['activation_8[0][0]']
conv2_3_1x1_increase/bn (Batch (None, 55, 55, 256) 1024 ['conv2_3_1x1_increase[0][0]']
Normalization)
add_2 (Add) (None, 55, 55, 256) 0 ['conv2_3_1x1_increase/bn[0][0]',
'activation_6[0][0]']
activation_9 (Activation) (None, 55, 55, 256) 0 ['add_2[0][0]']
conv3_1_1x1_reduce (Conv2D) (None, 28, 28, 128) 32768 ['activation_9[0][0]']
conv3_1_1x1_reduce/bn (BatchNo (None, 28, 28, 128) 512 ['conv3_1_1x1_reduce[0][0]']
rmalization)
activation_10 (Activation) (None, 28, 28, 128) 0 ['conv3_1_1x1_reduce/bn[0][0]']
conv3_1_3x3 (Conv2D) (None, 28, 28, 128) 147456 ['activation_10[0][0]']
conv3_1_3x3/bn (BatchNormaliza (None, 28, 28, 128) 512 ['conv3_1_3x3[0][0]']
tion)
activation_11 (Activation) (None, 28, 28, 128) 0 ['conv3_1_3x3/bn[0][0]']
conv3_1_1x1_increase (Conv2D) (None, 28, 28, 512) 65536 ['activation_11[0][0]']
conv3_1_1x1_proj (Conv2D) (None, 28, 28, 512) 131072 ['activation_9[0][0]']
conv3_1_1x1_increase/bn (Batch (None, 28, 28, 512) 2048 ['conv3_1_1x1_increase[0][0]']
Normalization)
conv3_1_1x1_proj/bn (BatchNorm (None, 28, 28, 512) 2048 ['conv3_1_1x1_proj[0][0]']
alization)
add_3 (Add) (None, 28, 28, 512) 0 ['conv3_1_1x1_increase/bn[0][0]',
'conv3_1_1x1_proj/bn[0][0]']
activation_12 (Activation) (None, 28, 28, 512) 0 ['add_3[0][0]']
conv3_2_1x1_reduce (Conv2D) (None, 28, 28, 128) 65536 ['activation_12[0][0]']
conv3_2_1x1_reduce/bn (BatchNo (None, 28, 28, 128) 512 ['conv3_2_1x1_reduce[0][0]']
rmalization)
activation_13 (Activation) (None, 28, 28, 128) 0 ['conv3_2_1x1_reduce/bn[0][0]']
conv3_2_3x3 (Conv2D) (None, 28, 28, 128) 147456 ['activation_13[0][0]']
conv3_2_3x3/bn (BatchNormaliza (None, 28, 28, 128) 512 ['conv3_2_3x3[0][0]']
tion)
activation_14 (Activation) (None, 28, 28, 128) 0 ['conv3_2_3x3/bn[0][0]']
conv3_2_1x1_increase (Conv2D) (None, 28, 28, 512) 65536 ['activation_14[0][0]']
conv3_2_1x1_increase/bn (Batch (None, 28, 28, 512) 2048 ['conv3_2_1x1_increase[0][0]']
Normalization)
add_4 (Add) (None, 28, 28, 512) 0 ['conv3_2_1x1_increase/bn[0][0]',
'activation_12[0][0]']
activation_15 (Activation) (None, 28, 28, 512) 0 ['add_4[0][0]']
conv3_3_1x1_reduce (Conv2D) (None, 28, 28, 128) 65536 ['activation_15[0][0]']
conv3_3_1x1_reduce/bn (BatchNo (None, 28, 28, 128) 512 ['conv3_3_1x1_reduce[0][0]']
rmalization)
activation_16 (Activation) (None, 28, 28, 128) 0 ['conv3_3_1x1_reduce/bn[0][0]']
conv3_3_3x3 (Conv2D) (None, 28, 28, 128) 147456 ['activation_16[0][0]']
conv3_3_3x3/bn (BatchNormaliza (None, 28, 28, 128) 512 ['conv3_3_3x3[0][0]']
tion)
activation_17 (Activation) (None, 28, 28, 128) 0 ['conv3_3_3x3/bn[0][0]']
conv3_3_1x1_increase (Conv2D) (None, 28, 28, 512) 65536 ['activation_17[0][0]']
conv3_3_1x1_increase/bn (Batch (None, 28, 28, 512) 2048 ['conv3_3_1x1_increase[0][0]']
Normalization)
add_5 (Add) (None, 28, 28, 512) 0 ['conv3_3_1x1_increase/bn[0][0]',
'activation_15[0][0]']
activation_18 (Activation) (None, 28, 28, 512) 0 ['add_5[0][0]']
conv3_4_1x1_reduce (Conv2D) (None, 28, 28, 128) 65536 ['activation_18[0][0]']
conv3_4_1x1_reduce/bn (BatchNo (None, 28, 28, 128) 512 ['conv3_4_1x1_reduce[0][0]']
rmalization)
activation_19 (Activation) (None, 28, 28, 128) 0 ['conv3_4_1x1_reduce/bn[0][0]']
conv3_4_3x3 (Conv2D) (None, 28, 28, 128) 147456 ['activation_19[0][0]']
conv3_4_3x3/bn (BatchNormaliza (None, 28, 28, 128) 512 ['conv3_4_3x3[0][0]']
tion)
activation_20 (Activation) (None, 28, 28, 128) 0 ['conv3_4_3x3/bn[0][0]']
conv3_4_1x1_increase (Conv2D) (None, 28, 28, 512) 65536 ['activation_20[0][0]']
conv3_4_1x1_increase/bn (Batch (None, 28, 28, 512) 2048 ['conv3_4_1x1_increase[0][0]']
Normalization)
add_6 (Add) (None, 28, 28, 512) 0 ['conv3_4_1x1_increase/bn[0][0]',
'activation_18[0][0]']
activation_21 (Activation) (None, 28, 28, 512) 0 ['add_6[0][0]']
conv4_1_1x1_reduce (Conv2D) (None, 14, 14, 256) 131072 ['activation_21[0][0]']
conv4_1_1x1_reduce/bn (BatchNo (None, 14, 14, 256) 1024 ['conv4_1_1x1_reduce[0][0]']
rmalization)
activation_22 (Activation) (None, 14, 14, 256) 0 ['conv4_1_1x1_reduce/bn[0][0]']
conv4_1_3x3 (Conv2D) (None, 14, 14, 256) 589824 ['activation_22[0][0]']
conv4_1_3x3/bn (BatchNormaliza (None, 14, 14, 256) 1024 ['conv4_1_3x3[0][0]']
tion)
activation_23 (Activation) (None, 14, 14, 256) 0 ['conv4_1_3x3/bn[0][0]']
conv4_1_1x1_increase (Conv2D) (None, 14, 14, 1024 262144 ['activation_23[0][0]']
)
conv4_1_1x1_proj (Conv2D) (None, 14, 14, 1024 524288 ['activation_21[0][0]']
)
conv4_1_1x1_increase/bn (Batch (None, 14, 14, 1024 4096 ['conv4_1_1x1_increase[0][0]']
Normalization) )
conv4_1_1x1_proj/bn (BatchNorm (None, 14, 14, 1024 4096 ['conv4_1_1x1_proj[0][0]']
alization) )
add_7 (Add) (None, 14, 14, 1024 0 ['conv4_1_1x1_increase/bn[0][0]',
) 'conv4_1_1x1_proj/bn[0][0]']
activation_24 (Activation) (None, 14, 14, 1024 0 ['add_7[0][0]']
)
conv4_2_1x1_reduce (Conv2D) (None, 14, 14, 256) 262144 ['activation_24[0][0]']
conv4_2_1x1_reduce/bn (BatchNo (None, 14, 14, 256) 1024 ['conv4_2_1x1_reduce[0][0]']
rmalization)
activation_25 (Activation) (None, 14, 14, 256) 0 ['conv4_2_1x1_reduce/bn[0][0]']
conv4_2_3x3 (Conv2D) (None, 14, 14, 256) 589824 ['activation_25[0][0]']
conv4_2_3x3/bn (BatchNormaliza (None, 14, 14, 256) 1024 ['conv4_2_3x3[0][0]']
tion)
activation_26 (Activation) (None, 14, 14, 256) 0 ['conv4_2_3x3/bn[0][0]']
conv4_2_1x1_increase (Conv2D) (None, 14, 14, 1024 262144 ['activation_26[0][0]']
)
conv4_2_1x1_increase/bn (Batch (None, 14, 14, 1024 4096 ['conv4_2_1x1_increase[0][0]']
Normalization) )
add_8 (Add) (None, 14, 14, 1024 0 ['conv4_2_1x1_increase/bn[0][0]',
) 'activation_24[0][0]']
activation_27 (Activation) (None, 14, 14, 1024 0 ['add_8[0][0]']
)
conv4_3_1x1_reduce (Conv2D) (None, 14, 14, 256) 262144 ['activation_27[0][0]']
conv4_3_1x1_reduce/bn (BatchNo (None, 14, 14, 256) 1024 ['conv4_3_1x1_reduce[0][0]']
rmalization)
activation_28 (Activation) (None, 14, 14, 256) 0 ['conv4_3_1x1_reduce/bn[0][0]']
conv4_3_3x3 (Conv2D) (None, 14, 14, 256) 589824 ['activation_28[0][0]']
conv4_3_3x3/bn (BatchNormaliza (None, 14, 14, 256) 1024 ['conv4_3_3x3[0][0]']
tion)
activation_29 (Activation) (None, 14, 14, 256) 0 ['conv4_3_3x3/bn[0][0]']
conv4_3_1x1_increase (Conv2D) (None, 14, 14, 1024 262144 ['activation_29[0][0]']
)
conv4_3_1x1_increase/bn (Batch (None, 14, 14, 1024 4096 ['conv4_3_1x1_increase[0][0]']
Normalization) )
add_9 (Add) (None, 14, 14, 1024 0 ['conv4_3_1x1_increase/bn[0][0]',
) 'activation_27[0][0]']
activation_30 (Activation) (None, 14, 14, 1024 0 ['add_9[0][0]']
)
conv4_4_1x1_reduce (Conv2D) (None, 14, 14, 256) 262144 ['activation_30[0][0]']
conv4_4_1x1_reduce/bn (BatchNo (None, 14, 14, 256) 1024 ['conv4_4_1x1_reduce[0][0]']
rmalization)
activation_31 (Activation) (None, 14, 14, 256) 0 ['conv4_4_1x1_reduce/bn[0][0]']
conv4_4_3x3 (Conv2D) (None, 14, 14, 256) 589824 ['activation_31[0][0]']
conv4_4_3x3/bn (BatchNormaliza (None, 14, 14, 256) 1024 ['conv4_4_3x3[0][0]']
tion)
activation_32 (Activation) (None, 14, 14, 256) 0 ['conv4_4_3x3/bn[0][0]']
conv4_4_1x1_increase (Conv2D) (None, 14, 14, 1024 262144 ['activation_32[0][0]']
)
conv4_4_1x1_increase/bn (Batch (None, 14, 14, 1024 4096 ['conv4_4_1x1_increase[0][0]']
Normalization) )
add_10 (Add) (None, 14, 14, 1024 0 ['conv4_4_1x1_increase/bn[0][0]',
) 'activation_30[0][0]']
activation_33 (Activation) (None, 14, 14, 1024 0 ['add_10[0][0]']
)
conv4_5_1x1_reduce (Conv2D) (None, 14, 14, 256) 262144 ['activation_33[0][0]']
conv4_5_1x1_reduce/bn (BatchNo (None, 14, 14, 256) 1024 ['conv4_5_1x1_reduce[0][0]']
rmalization)
activation_34 (Activation) (None, 14, 14, 256) 0 ['conv4_5_1x1_reduce/bn[0][0]']
conv4_5_3x3 (Conv2D) (None, 14, 14, 256) 589824 ['activation_34[0][0]']
conv4_5_3x3/bn (BatchNormaliza (None, 14, 14, 256) 1024 ['conv4_5_3x3[0][0]']
tion)
activation_35 (Activation) (None, 14, 14, 256) 0 ['conv4_5_3x3/bn[0][0]']
conv4_5_1x1_increase (Conv2D) (None, 14, 14, 1024 262144 ['activation_35[0][0]']
)
conv4_5_1x1_increase/bn (Batch (None, 14, 14, 1024 4096 ['conv4_5_1x1_increase[0][0]']
Normalization) )
add_11 (Add) (None, 14, 14, 1024 0 ['conv4_5_1x1_increase/bn[0][0]',
) 'activation_33[0][0]']
activation_36 (Activation) (None, 14, 14, 1024 0 ['add_11[0][0]']
)
conv4_6_1x1_reduce (Conv2D) (None, 14, 14, 256) 262144 ['activation_36[0][0]']
conv4_6_1x1_reduce/bn (BatchNo (None, 14, 14, 256) 1024 ['conv4_6_1x1_reduce[0][0]']
rmalization)
activation_37 (Activation) (None, 14, 14, 256) 0 ['conv4_6_1x1_reduce/bn[0][0]']
conv4_6_3x3 (Conv2D) (None, 14, 14, 256) 589824 ['activation_37[0][0]']
conv4_6_3x3/bn (BatchNormaliza (None, 14, 14, 256) 1024 ['conv4_6_3x3[0][0]']
tion)
activation_38 (Activation) (None, 14, 14, 256) 0 ['conv4_6_3x3/bn[0][0]']
conv4_6_1x1_increase (Conv2D) (None, 14, 14, 1024 262144 ['activation_38[0][0]']
)
conv4_6_1x1_increase/bn (Batch (None, 14, 14, 1024 4096 ['conv4_6_1x1_increase[0][0]']
Normalization) )
add_12 (Add) (None, 14, 14, 1024 0 ['conv4_6_1x1_increase/bn[0][0]',
) 'activation_36[0][0]']
activation_39 (Activation) (None, 14, 14, 1024 0 ['add_12[0][0]']
)
conv5_1_1x1_reduce (Conv2D) (None, 7, 7, 512) 524288 ['activation_39[0][0]']
conv5_1_1x1_reduce/bn (BatchNo (None, 7, 7, 512) 2048 ['conv5_1_1x1_reduce[0][0]']
rmalization)
activation_40 (Activation) (None, 7, 7, 512) 0 ['conv5_1_1x1_reduce/bn[0][0]']
conv5_1_3x3 (Conv2D) (None, 7, 7, 512) 2359296 ['activation_40[0][0]']
conv5_1_3x3/bn (BatchNormaliza (None, 7, 7, 512) 2048 ['conv5_1_3x3[0][0]']
tion)
activation_41 (Activation) (None, 7, 7, 512) 0 ['conv5_1_3x3/bn[0][0]']
conv5_1_1x1_increase (Conv2D) (None, 7, 7, 2048) 1048576 ['activation_41[0][0]']
conv5_1_1x1_proj (Conv2D) (None, 7, 7, 2048) 2097152 ['activation_39[0][0]']
conv5_1_1x1_increase/bn (Batch (None, 7, 7, 2048) 8192 ['conv5_1_1x1_increase[0][0]']
Normalization)
conv5_1_1x1_proj/bn (BatchNorm (None, 7, 7, 2048) 8192 ['conv5_1_1x1_proj[0][0]']
alization)
add_13 (Add) (None, 7, 7, 2048) 0 ['conv5_1_1x1_increase/bn[0][0]',
'conv5_1_1x1_proj/bn[0][0]']
activation_42 (Activation) (None, 7, 7, 2048) 0 ['add_13[0][0]']
conv5_2_1x1_reduce (Conv2D) (None, 7, 7, 512) 1048576 ['activation_42[0][0]']
conv5_2_1x1_reduce/bn (BatchNo (None, 7, 7, 512) 2048 ['conv5_2_1x1_reduce[0][0]']
rmalization)
activation_43 (Activation) (None, 7, 7, 512) 0 ['conv5_2_1x1_reduce/bn[0][0]']
conv5_2_3x3 (Conv2D) (None, 7, 7, 512) 2359296 ['activation_43[0][0]']
conv5_2_3x3/bn (BatchNormaliza (None, 7, 7, 512) 2048 ['conv5_2_3x3[0][0]']
tion)
activation_44 (Activation) (None, 7, 7, 512) 0 ['conv5_2_3x3/bn[0][0]']
conv5_2_1x1_increase (Conv2D) (None, 7, 7, 2048) 1048576 ['activation_44[0][0]']
conv5_2_1x1_increase/bn (Batch (None, 7, 7, 2048) 8192 ['conv5_2_1x1_increase[0][0]']
Normalization)
add_14 (Add) (None, 7, 7, 2048) 0 ['conv5_2_1x1_increase/bn[0][0]',
'activation_42[0][0]']
activation_45 (Activation) (None, 7, 7, 2048) 0 ['add_14[0][0]']
conv5_3_1x1_reduce (Conv2D) (None, 7, 7, 512) 1048576 ['activation_45[0][0]']
conv5_3_1x1_reduce/bn (BatchNo (None, 7, 7, 512) 2048 ['conv5_3_1x1_reduce[0][0]']
rmalization)
activation_46 (Activation) (None, 7, 7, 512) 0 ['conv5_3_1x1_reduce/bn[0][0]']
conv5_3_3x3 (Conv2D) (None, 7, 7, 512) 2359296 ['activation_46[0][0]']
conv5_3_3x3/bn (BatchNormaliza (None, 7, 7, 512) 2048 ['conv5_3_3x3[0][0]']
tion)
activation_47 (Activation) (None, 7, 7, 512) 0 ['conv5_3_3x3/bn[0][0]']
conv5_3_1x1_increase (Conv2D) (None, 7, 7, 2048) 1048576 ['activation_47[0][0]']
conv5_3_1x1_increase/bn (Batch (None, 7, 7, 2048) 8192 ['conv5_3_1x1_increase[0][0]']
Normalization)
add_15 (Add) (None, 7, 7, 2048) 0 ['conv5_3_1x1_increase/bn[0][0]',
'activation_45[0][0]']
activation_48 (Activation) (None, 7, 7, 2048) 0 ['add_15[0][0]']
avg_pool (AveragePooling2D) (None, 1, 1, 2048) 0 ['activation_48[0][0]']
flatten (Flatten) (None, 2048) 0 ['avg_pool[0][0]']
dropout (Dropout) (None, 2048) 0 ['flatten[0][0]']
classifier (Dense) (None, 99) 202851 ['dropout[0][0]']
==================================================================================================
Total params: 23,764,003
Trainable params: 202,851
Non-trainable params: 23,561,152
__________________________________________________________________________________________________