Upgrade to Pro — share decks privately, control downloads, hide ads and more …

レシピの画像検索

johshisha
April 14, 2019
960

 レシピの画像検索

第52回 コンピュータビジョン勉強会@関東
https://kantocv.connpass.com/event/125101/

johshisha

April 14, 2019
Tweet

Transcript

  1. 自己紹介 2 • 三條 智史 [ @johshisha ] • 同志社大学大学院

    修士 • クックパッド株式会社 ◦ 2018年新卒入社(2年目) ◦ 研究開発部 ◦ 広告推薦,見栄え推定 • カルピスが好き
  2. > 特定物体認識 > 同じオブジェクトが写っている画像を取得 4 画像検索 と レシピの画像検索 > レシピの画像検索

    > 想定するユースケースの場合 > 同じ料理を実現できるレシピを取得 クエリ 結果 クエリ 結果
  3. > hand-craftな大域特徴 (global feature)ベース > 画像から一つの特徴ベクトルを得る > カラーヒストグラムやGISTなど [Douze+, 2009]

    > 背景がごちゃごちゃしている場合などにうまくいかない > hand-craftな局所特徴 (local feature)ベース > 画像から多数の局所特徴ベクトルを得る > SIFT, SURFなど [Zheng+, 2018] > 多数のベクトルを生成 → 集約する (BoVW, VLAD) 画像検索の手法 6
  4. > CNNの大域特徴ベース > 一般物体認識や様々な分野でのCNNの性能向上に触発 > pretrained modelの特徴量使ったり,fine-tuningしたり [Razavian+, 2014] >

    CNNの局所特徴ベース > 大域特徴では,背景がごちゃごちゃしていると厳しい > CNNから局所特徴を抽出 [Ng+, 2015] > 画像をpatchに分割したり,重要そうな部分のみ使ったり 画像検索の手法 7
  5. > 基本的には一般的な画像検索と同じ流れ(後追い) > hand-craftな特徴を用いた手法 [Farinella+, 2016] > CNNによる大域特徴を用いた手法 > (次はCNNによる局所特徴を用いた手法が来る?)

    > レシピには画像以外にもテキストがある(食材,手順など) > Cross-modalなレシピ検索手法 レシピの画像検索の手法 8
  6. > 基本的には一般的な画像検索と同じ流れ(後追い) > hand-craftな特徴を用いた手法 [Farinella+, 2016] > CNNによる大域特徴を用いた手法 > (次はCNNによる局所特徴を用いた手法が来る?)

    > レシピには画像以外にもテキストがある(食材,手順など) > Cross-modalなレシピ検索手法 レシピの画像検索の手法 これらの手法について詳しく説明する 9
  7. > 基本的には一般的な画像検索と同じ流れ(後追い) > hand-craftな特徴を用いた手法 [Farinella+, 2016] > CNNによる大域特徴を用いた手法 > (次はCNNによる局所特徴を用いた手法が来る?)

    > レシピには画像以外にもテキストがある(食材,手順など) > Cross-modalなレシピ検索手法 レシピの画像検索の手法 10
  8. > Learning CNN-based Features for Retrieval of Food Images >

    Ciocca+ , ICIAP 2017 > 分類ベースの手法 > Learning Food Image Similarity for Food Image Retrieval > Shimoda+ , BigMM 2017 > 特徴空間上での距離ベースの手法 CNNによる大域特徴を用いた手法 11
  9. Learning CNN-based Features for Retrieval of Food Images [Ciocca+ ,

    ICIAP 2017] 12 > 料理ドメインにおいてもCNN-based featuresが有用なのかを検証する > 料理の524クラス分類のタスクでResNet-50をfine-tuning > Classification Accuracy: 69.52% for the Top-1, and 89.61% for the Top-5 > 最後のFCから特徴抽出
  10. > テストデータセット > 4,754枚,1,200種類の料理 > 様々な国の料理 > タスク > クエリと同じ料理の写真を取得する

    > 検索対象は1200種類の料理各1枚ずつ 実験結果 http://iplab.dmi.unict.it/UNICT-FD1200/VisualAnalysis_1.htm 13
  11. > Siamese Network [Bromley+, 1994] > クエリと対象サンプル > 似ている場合は近くなるように >

    似ていない場合は遠くなるように > Triplet Network [Wang+, 2014] > クエリと2つのサンプル > 似ているものが似ていないものよりも 近くなるように > 選択されたサンプル間の関係性を学習 2つのネットワークを検証 15
  12. Siamese Network のロス関数 : サンプル画像 Y : が似ているものなら1,違えば0 C :

    マージン D : ユークリッド距離 f : 特徴抽出関数 やりたいこと: (indexのiは省略) 2つの画像が似ている場合 似ていない場合 似ている画像は距離が近くなるように 似ていない画像は距離が遠くなるように Cより距離が遠くな ればLossは0 16
  13. Triplet Network のロス関数 p : クエリ画像 : 似ているサンプル画像 (positive sample)

    : 似ていないサンプル画像 (negative sample) D : ユークリッド距離 f : 特徴抽出関数 (indexのiは省略) 似ている画像との距離 似ていない画像との距離 似ていない画像 よりも 似ている画像 との距離が 近ければ Lossは0 クエリと選択された2つの画像との関係性を定義 17 やりたいこと:
  14. > データセット: UEC-FOOD256 [Kawano+, 2014] > 256クラス,100枚/class,25,600枚 > タスク >

    クエリと同じクラスの画像を取得できるか 実験結果 FT: fine-tuning SN: siamese network TN: triplet network MT: multi-task ( combine Classification Loss ) 19
  15. > 基本的には一般的な画像検索と同じ流れ(後追い) > hand-craftな特徴を用いた手法 [Farinella+, 2016] > CNNによる大域特徴を用いた手法 > (次はCNNによる局所特徴を用いた手法が来る?)

    > レシピには画像以外にもテキストがある(食材,手順など) > Cross-modalなレシピ検索手法 レシピの画像検索の手法 20
  16. > Learning Cross-modal Embeddings for Cooking Recipes and Food Images

    > Salvador+ , CVPR 2017 > 大雑把にいうと: Siamese Network + Classification Loss + Cross-modal > Cross-Modal Retrieval in the Cooking Context: Learning Semantic Text-Image Embeddings > Carvalho+ , SIGIR 2018 > 大雑把に言うと: Triplet Network + Classification Loss + Cross-modal Cross-modalなレシピ検索手法 21
  17. 22 Learning Cross-modal Embeddings for Cooking Recipes and Food Images

    [Salvador+ , CVPR 2017] > 料理に関する大規模データセットのRecipe1Mを作ったよ! > これがあればこんなことできるよ! > 画像→レシピ検索で 人間を超えた
  18. 分類ロス (Semantic Regularization Loss) Cosine Similarity Loss Semantic Regularization Loss

    パラメータ (論文では0.02) クラスラベル > カテゴリも考慮できるようにする > テキスト・画像両方で同じ重みを用いて分類 25
  19. 検索性能: vs. 関連手法 > ランダムな1000サンプルのサブセットを作成 > 厳密には ランダムな999 + クエリ画像と同じレシピのテキスト

    > サブセット内にある同じレシピのテキストを見つける > 10回1000サンプルを選び直した平均値 26
  20. 28 Cross-Modal Retrieval in the Cooking Context: Learning Semantic Text-Image

    Embeddings [Carvalho+ , SIGIR 2018] > 分類ロスだと特徴空間上でのクラスごとのまとまりを保証できない > 未知のサンプルに対してのロバスト性に欠ける > Triplet Lossの導入
  21. > instance-based triplets > 同じレシピのものは違うレシピよりも近く Double Triplet Loss 関数 同じレシピ

    違うレシピ 同じカテゴリ 違うカテゴリ (変数の説明はだいたい同じなので省略 ) 30 > semantic-based triplets > 同じカテゴリのものは違うカテゴリより近く
  22. > レシピの画像検索 > 一般的な画像検索と考えとしては同じ > 特徴: 画像のみならず,テキストも使える > 所感 >

    基本的には一般的な画像検索で優れた手法がレシピに転用されているので 最新の手法を追うのは大事 > 想定するのユースケースでは,未知の画像へのロバスト性は大事 > Double Triplet Loss が有用そう まとめ 34
  23. • [Douze+, 2009] ◦ Douze, Matthijs, et al. "Evaluation of

    gist descriptors for web-scale image search." Proceedings of the ACM International Conference on Image and Video Retrieval. ACM, 2009. • [Zheng+, 2018] ◦ Zheng, Liang, Yi Yang, and Qi Tian. "SIFT meets CNN: A decade survey of instance retrieval." IEEE transactions on pattern analysis and machine intelligence 40.5 (2018): 1224-1244. • [Razavian+, 2014] ◦ Sharif Razavian, Ali, et al. "CNN features off-the-shelf: an astounding baseline for recognition." Proceedings of the IEEE conference on computer vision and pattern recognition workshops. 2014. • [Ng+, 2015] ◦ Yue-Hei Ng, Joe, Fan Yang, and Larry S. Davis. "Exploiting local features from deep networks for image retrieval." Proceedings of the IEEE conference on computer vision and pattern recognition workshops. 2015. 参考文献 35
  24. • [Farinella+, 2016] ◦ Farinella, Giovanni Maria, et al. "Retrieval

    and classification of food images." Computers in biology and medicine 77 (2016): 23-39. • [Ciocca+ , ICIAP 2017] ◦ Ciocca, Gianluigi, Paolo Napoletano, and Raimondo Schettini. "Learning cnn-based features for retrieval of food images." International Conference on Image Analysis and Processing. Springer, Cham, 2017. • [Shimoda+ , BigMM 2017] ◦ Shimoda, Wataru, and Keiji Yanai. "Learning food image similarity for food image retrieval." 2017 IEEE Third International Conference on Multimedia Big Data (BigMM). IEEE, 2017. • [Salvador+ , CVPR 2017] ◦ Salvador, Amaia, et al. "Learning cross-modal embeddings for cooking recipes and food images." Proceedings of the IEEE conference on computer vision and pattern recognition. 2017. • [Carvalho+ , SIGIR 2018] ◦ Carvalho, Micael, et al. "Cross-modal retrieval in the cooking context: Learning semantic text-image embeddings." The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval. ACM, 2018. 参考文献 36
  25. 参考文献 • [Zhou+, 2017] ◦ Zhou, Wengang, Houqiang Li, and

    Qi Tian. "Recent advance in content-based image retrieval: A literature survey." arXiv preprint arXiv:1706.06064 (2017). • [Bromley+, 1994] ◦ Bromley, Jane, et al. "Signature verification using a" siamese" time delay neural network." Advances in neural information processing systems. 1994. • [Wang+, 2014] ◦ Wang, Jiang, et al. "Learning fine-grained image similarity with deep ranking." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2014. • [Kawano+, 2014] ◦ Kawano, Yoshiyuki, and Keiji Yanai. "Automatic expansion of a food image dataset leveraging existing categories with domain adaptation." European Conference on Computer Vision. Springer, Cham, 2014. 37