Food101データセットを触ってみる

Food101という101クラスの料理画像がラベルとセットになっているデータセットがある。 こちらを触ってみる。

クラスごとに250枚のテスト画像と750枚の訓練画像があり、全部で101000枚画像が用意されている。 オリジナルだと画像の最大サイズは同じ(512pixel)にスケールされているものの、もう片方の辺はバラバラのようなので、 kaggleのここを参考にサイズが揃ったデータを取得し可視化だけしてみる。

def visualize_data():
    base_path = "./dataset"
    train_h5_path = os.path.join(base_path, "food_c101_n10099_r64x64x3.h5")
    test_h5_path = os.path.join(base_path, "food_test_c101_n1000_r64x64x3.h5")
    print(os.path.exists(train_h5_path))
    print(os.path.exists(test_h5_path))

    with h5py.File(train_h5_path, 'r') as n_file:
        total_imgs = n_file['images'].shape[0]
        read_idxs = slice(0, total_imgs)

        img_data = n_file['images'][read_idxs]
        img_label = n_file['category'].value[read_idxs]
        label_names = [x.decode() for x in n_file['category_names'].value]

    fig, m_ax = plt.subplots(5, 5, figsize = (12, 12))
    for c_ax, c_label, c_img in zip(m_ax.flatten(), img_label, img_data):
        c_ax.imshow(c_img)
        c_ax.axis('off')
        c_ax.set_title(label_names[np.argmax(c_label)])

f:id:yusuke_ujitoko:20190112122433p:plain

Vibrotactile Display: Perception, Technology, and Applicationsを読んだ

S.ChoiとK.J.Kuchenbeckerによるvibrotactile displayの入門書を読んだ. 12ページと分量も多くないし,簡潔に書かれていてとても良みやすいと思う. 振動触覚を仕事で扱う人や学生さん(私)にぜひオススメ.

振動触覚のアプリでの活用時のデザインのTipsが所々に載っていた. Choi氏のご自身の論文がそういった観点で引用されていたので今後読んでいきたい.

以下は私のメモ

2章 振動触覚知覚

ユーザは振動触覚を感じられるか?

  • 人が感じられる最小刺激が調査されてきた.
    • 最小刺激は色んな要素によって変化する.部位・接触面積・刺激の長さ・刺激する波形・接触力・皮膚温度・他のマスキング刺激・年齢など.例えば接触面積や刺激の時間が長いと,summation effectで閾値は下がる.
  • 指を直接刺激する場合の閾値について詳しくは以下を参照
    • L.A.Jones and S. J. Lederman, "Human Hand Function". New York: Oxford Univ. Press, 2006.
    • G.A.Gescheider, J. H. Wright, and R. T. Verrillo, "Information-Processing Channels in the Tactile Sensory System: A Psychophysical and Physiological Analysis". New York: Psychology Press, 2008.
  • 道具を介した振動による刺激の場合の閾値について詳しくは以下を参照
    • M.Morioka and M. J. Griffin, "Thresholds for the perception of hand-transmitted vibration: Dependence on contact area and contact location," Somatosens. Motor Res., vol. 22, no. 4, pp. 281–297, 2005.
    • J.Ryu, J. Jung, G. Park, and S. Choi, "Psychophysical model for vibrotactile rendering in mobile devices", Presence, Teleoper. Virtual Environ., vol. 19, no. 4, pp. 1–24, 2010.

ユーザは2つの異なる振動を区別できるか?

  • 2つの刺激を十分区別できる最小の刺激の違い(JND)が調査されてきた
    • 通常,JNDは比較刺激に依存して変化するけど,Weber fractionは一定になる傾向がある.ところが振動知覚の場合は例外的で幅がある.
      • 刺激の強さに対するWeber fractionはだいたい10%-30%.
      • 周波数に対するWeber fractionはだいたい15%-30%
    • 筆者らによると実際のアプリで振動刺激の差分をロバストにユーザに伝える場合には,概して20%-30%の差分は刺激強度・周波数野どちらに対しても必要とのこと.結構大きい.

刺激はどのくらい強く感じられるか?

  • 刺激の大きさが人が感じられる最小刺激よりも大きいとき,大きさが感じられる
  • その感じられる大きさは,刺激がIとするときsteven’s power lawに従ってφ(I)= kIeとなる
    • eは振動刺激の場合0.35~0.86の間
    • eは周波数を始め刺激環境に依存

刺激のタイミングをどれくらい正確に判断できるか?

  • 振動刺激の場合刺激タイミングは結構正確に判断できる
    • パルス刺激を連続的に提示したとき振動刺激の場合5ms間隔の刺激を区別できる
      • G.A. Gescheider, J. H. Wright, and R. T. Verrillo, "Information-Processing Channels in the Tactile Sensory System: A Psychophysical and Physiological Analysis". New York: Psychology Press, 2008.
    • これは視覚よりも高速(25ms).でも聴覚よりは遅い(0.01ms)
      • L.A. Jones and S. J. Lederman, "Human Hand Function". New York: Oxford Univ. Press, 2006.

振動触覚による他の知覚効果は?

  • 周波数によって感じられ方が変わる
    • H.Z. Tan, N. I. Durlach, C. M. Reed, and W. M. Rabinowitz, "Information transmission with a multifinger tactual display", Percep. Psychophys., vol. 61, no. 6, pp. 993–1008, 1999.
    • 3Hz以下だとkinesthetic motionに感じられる
    • 10-70Hzだと粗い動きやflutteringに感じられる
    • 100-300Hzだとスムーズな振動に感じられる

  • 主観的評価は振幅のenvelopによって変わる
    • 低周波の波形と高周波の正弦波をかけ合わせると(振幅変調
      • 低周波の粗い感覚になる(もともとの高周波の滑らかな振動ではなくなる)
    • 要チェック
      • G.Park and S. Choi, "Perceptual space of amplitude-modulated vibrotactile stimuli", in Proc. IEEE World Haptics Conf., 2011, pp. 59–64.

2つの隣接する振動刺激をどれくらい正確に区別できるか?

  • 2つのプローブを同時に使って皮膚を刺激して,2点弁別閾で空間の識別性を調べてきた ところが2つのプローブからの同時刺激する分,刺激強さが大きくなり影響を及ぼす可能性あり.
  • 現在は代わりに
    • 1点のみ刺激してlocalization thresholdsを調査(刺激は1度に1点のみ)
    • grating orientation thresholdを調査(よくわからない)

時空間的なパターン刺激に対して何を感じられるか?

  • この辺はよくあるやつだったので割愛(ファントムセンセーション等)

7章 アプリ(マルチメディア)

私達の作ってる触覚デザインを効率化する振動の生成モデルも 以下の文脈に絡めて位置付けを紹介しないとダメなんだなと思った.

オーサリン

マルチメディアアプリでは触覚は視覚や聴覚と同期させてユーザに伝える必要がある. そのような同期を実現するためにデザイナーはツールを使うが,大きく2つのアプローチがある.

  • 1つは動画や音声に合わせてスクラッチで振動を作る方法.
      1. Kim, J. Cha, I. Oakley, and J. Ryu,: Exploring tactile movies: An initial tactile glove design and concept evaluation, IEEE Multimedia, 2009, DOI: 10.1109/MMUL. 2009.63
      1. Lee and S. Choi, :Evaluation of vibrotactile pattern design using vibrotactile score, in Proc. IEEE Haptics Symp., 2012, pp. 231–238.
  • もう1つは動画や音声から自動生成する方法.
    • こちらはあまり進んでいない.

自分のサイトでのプレプリント等の公開ポリシー(IEEE, Springer,ACM)

研究者の個人サイトにプレプリントのpdfを載せている人がいる. それに倣って,自分も書いた論文を自分のサイトに載せたいと思い,ポリシーを調べてみた

原稿の段階別の分類

原稿のIEEEによる分類.

# 種類 説明
1 preprint どこにも提出する前の下書き原稿
2 Author-submitted article 提出したバージョンの原稿
3 Accepted article (postprint) 採択後の原稿.査読の指摘などを受けて修正後のバージョン
4 Published article copyeditingやformattingが全て行われた原稿

以下は自分に関係しそうなジャーナルの規則を調べたメモ.

IEEE

以下はココの情報を抽出したもの.
もっと詳しい情報へのリンクが上記リンク内にあるので辿れる.

  • preprint
    • 著者個人サイト,著者所属元サイト,arXivへの掲載OK.
    • 投稿後にpreprintを掲載する際にはIEEEのクレジットを最初のページに載せること.
      • “© 20XX IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.”

    • 出版時にはDOIも追記すること

  • Author-submitted article
    • 著者個人サイト,著者所属元サイトへの掲載OK
    • 著者授業での使用OK等
    • 論文中にIEEEのクレジットが必須
      • “© 20XX IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.”

    • IEEEでpaperが出版時にはDOIを更新するか,accepted articleに入れ替えること

  • Accepted article
    • 著者個人サイト,著者所属元サイト,arXivへの掲載OK.
    • Funderのレポジトリは掲載OK(意図不明)
    • 論文中にIEEEのクレジットが必須
      • “© 20XX IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.”

  • Final published article
    • オープンアクセスになっていないものはオンラインでの掲載NG
    • 個人利用で配るのはOK
    • 要件を満たせば学位論文で用いることはOK
    • 論文中にIEEEのクレジットが必須
      • “© 20XX IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.”

Springer

以下はココの情報を抽出したもの

  • preprint(査読前)
    • 著者個人サイト,著者所属元サイト,arXiv,biorXiv, RePEc等の非商用論文共有サイトへの掲載OK
    • ResearchGate,Academia.edu,Mendeleyのような商用論文共有サイトは不可
    • 論文出版されたらpreprintのacknowledgement欄に出版社のリンクを次のように貼ること.
      • “This is a pre-print of an article published in [insert journal title]. The final authenticated version is available online at: https://doi.org/[insert DOI]”.

  • Accepted article
    • 著者個人サイトへは即時掲載OK
    • 著者所属元サイトへの掲載は出版の12ヶ月後以降はOK
    • ResearchGate,Academia.edu,Mendeleyのような商用論文共有サイトは不可
    • acknowledgement欄に次のクレジットが必要
      • This is a post-peer-review, pre-copyedit version of an article published in [insert journal title]. The final authenticated version is available online at: http://dx.doi.org/[insert DOI]”.

ACM

以下はココの情報を抽出したもの.

  • preprint, accepted article(両方共同じ)
    • 著者個人サイト,著者所属サイト,非商用論文共有サイト(arXiv.org等)

canvasにキーボードイベントを設定する

HTML5 canvasにキーボードイベントを設定するには, canvas要素のtabindexを0に設定しなければならない.

<canvas id="canvas" tabindex="0"></canvas>
var canvas = document.getElementById("canvas");
canvas.addEventListener("keydown", function(e){
    if (e.keyCode == 13){
        console.log("Enter is pressed")
    }
}, false);