sin392 / manazashi

For DCON2020
0 stars 0 forks source link

顔検出を試す #10

Open sin392 opened 4 years ago

sin392 commented 4 years ago

目的

授業への関心や不満の指標として表情や視線を利用することを検討している。 前段階として、複数人の撮影動画に対する顔検出を試す。 必要に応じて転移学習等も行う。

前提条件

2 #9

完了条件

撮影動画に対して顔検出を行い、結果をレポートすること。

タスク

bikyo commented 4 years ago

Kerasを用いて、VGG16のモデルを転移学習させて切り出した画像から人の顔を判別するモデルをネットから探して実行してみた たしかに何かしらの特徴をつかんでいるかのような分類(同じ人の顔はおおむね1つのグループにまとめられた)を行っていたが、人の顔を判別はできなかった もうちょっとデータを集めてきちんと学習させてから判別するようにしていく

sin392 commented 4 years ago

なるほど、opencvの方はhaarcascade使ったんですね。 VGGの方のレポートも待ってます。 可能だったら以下のような検出の様子も見てみたいです。 20160218005019

sin392 commented 4 years ago

dlibでHOG&SVM(青)とCNN(赤)のテスト HOG SVM_CNN

sin392 commented 4 years ago

dlib : mmod_human_face_detector (max margin object detection) https://github.com/davisking/dlib-models mmod_human_face_detector

upsample_num_times 2 → window size 20×20 → 3にするとOOM 実行時間 : 4s

sin392 commented 4 years ago

メモリ消費量が多いのでモデル自体を変えたほうがいいかもしれない

sin392 commented 4 years ago

dlibの転移学習について https://translate.googleusercontent.com/translate_c?depth=1&hl=ja&prev=search&rurl=translate.google.com&sl=en&sp=nmt4&u=https://stackoverflow.com/questions/44876785/dlib-face-detection-failing-to-catch%3Frq%3D1&xid=17259,15700022,15700186,15700190,15700256,15700259,15700262,15700265,15700271,15700283&usg=ALkJrhgT05hmsj6koLQLNAGhs2Y6r76wQg

sin392 commented 4 years ago

@iso-jet yolov3やSSDといった物体検出モデルで顔検出をさせてみる @HimHim1113 非DL検出器→顔認識 を試してみる

sin392 commented 4 years ago

pytorchのfacenet実装試してみた 検出モデル自体はMTCNNなのでさほど変わらないが...

output_facenet

confidence : thresholds=[0.6, 0.7, 0.7]

rects, preds = mtcnn.detect(img)... 0 0.9970695376396179 1 0.9621299505233765 2 0.999845027923584 3 0.9775848984718323 4 0.7722111344337463 5 0.9937999844551086 6 0.9953081011772156 7 0.9734599590301514 8 0.9878333806991577 9 0.7551294565200806 10 0.8822581171989441 11 0.9998670816421509 12 0.990210771560669

閾値の引き下げは誤検出が増えるだけだった

sin392 commented 4 years ago

人物bboxと顔bboxの重なり(IoU)を見て色変え image_00032_m2det_facenet 他の人物とbboxが重なってる場合の処理を検討する必要あり

sin392 commented 4 years ago

・IoUの参照の仕方を変更 ・face/person rateの表示 image_00032_m2det_facenet_rate

iso-jet commented 4 years ago

デフォルトのモデルでの結果 yolov3_sample_1 yolov3_sample_2 yolov3_sample_3

iso-jet commented 4 years ago

このモデルはcocoデータセットをもとに学習しており顔のラベルがなかったのでwider-faceの顔画像をもとに転移学習をさせることにした。 転移学習を試してみたが訓練の段階でエポック数がある一定数を超えるとlossがnanに飛んでしまう現象が起き、その調査中