Copyright (C) Present Square Co., Ltd. All Rights Reserved.
3. 手法
12
• 各画像とテキストの類似度を取得。
• バッチ内のN個の実ペアの画像とテキストのエンベディングのコサ
イン類似度を最大化する一方で、不正確なペアのエンベディン
グのコサイン類似度を最小化する。
CLIPのモデル:(1)対照事前学習
Copyright (C) Present Square Co., Ltd. All Rights Reserved.
3. 手法
13
CLIPのモデル
(2)ラベルテキストからデータセット
分類器を作成
(3)ゼロショット予測
• プロンプト“ a photo of a {object}”の付与
など。
Copyright (C) Present Square Co., Ltd. All Rights Reserved.
3. 手法
プロンプトエンジニアリング
16
必要となる背景
⑴多義語問題 • 多義語の意味が定まらないという問題。
例)cranes(動物の鶴と重機のクレーン)、boxer (動物の犬種とスポーツ選手)
⑵単語問題 • 与えるカテゴリーリストが単語だけでは高い精度での予測ができないという問題。
対応
• プロンプトを“ a photo of a {label}”とする。(ImageNetの場合、1.3%の
性能の改善)
• ” a photo of a {label}, a type of pet” など、ベンチマークデータセットのタイ
プがわかっている場合は情報を追加。
• OCRデータセットでは、認識したいテキストや数字の周りに引用符を付けることや、
衛星画像の照合データセットでは画像がどの形式のものであるかを特定できる ” a
satellite photo of a {label}. “といった工夫が行われている。
• 加えて、プロンプトのアンサンブル学習(80の異なるプロンプトを利用)することで
3.5%の精度上昇が確認された。(両対応で約5%の上昇。)
Copyright (C) Present Square Co., Ltd. All Rights Reserved.
4. 実験
出力例
17
• 画素が低いものに弱い傾向
• プロンプトエンジニアリングを含む
Copyright (C) Present Square Co., Ltd. All Rights Reserved.
Appendix
参考文献
• Desai, K. and Johnson, J. Virtex: Learning visual representations from textual annotations. arXiv preprint
arXiv:2006.06666, 2020.
• Zhang, Y., Jiang, H., Miura, Y., Manning, C. D., and Langlotz, C. P. Contrastive learning of medical visual representations
from paired images and text. arXiv preprintarXiv:2010.00747, 2020.
• Griewank, A. and Walther, A. Algorithm 799: revolve: an implementation of checkpointing for the reverse or adjoint
mode of computational differentiation. ACM Transactions on Mathematical Software (TOMS), 26(1):19–45, 2000.
• Micikevicius, P., Narang, S., Alben, J., Diamos, G., Elsen, E., Garcia, D., Ginsburg, B., Houston, M., Kuchaiev, O.,
Venkatesh, G., et al. Mixed precision training. arXiv preprint arXiv:1710.03740, 2017.
• Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. Attention is all
you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
• Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold,
G., Gelly, S., et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint
arXiv:2010.11929, 2020.
• Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell,
A., et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
25