字が汚い。
字が踊っている、独自言語を作るな、ミミズを飼われているんですか、小学生といい勝負ですね、字の乱れは心の乱れ、などと暴言は咲き乱れ・・・。
直そうとは思っているのですが、早さを追求してしまい汚くなってしまいます。直したい、人に強いられてでも矯正したい。
ところで字が汚いときれいの境目って何でしょうか。
習字の先生が決める、てかそもそも境目なんて存在しない。答えは∞。
僕が思う境目はこれです!
機械が決める!
将来機械と人がともに働く世界がきます。
ってなわけで実際に僕の字を機械に判別してもらいましょう。
お品書き
汚さの定義について
とはいえ字の汚さの定義があいまいなので次の2つを字の汚さを
・正答率が低い
と定義します。認識時間も入れようとしたのですが、実行するたびに時間が変わってしまったので割愛します。
見様見まねで機械学習させてみる
とはいえ高度なテクニックをしている人がいるのか・・・。
いた~~~~~~~~しかもGoogleColaboratory~~~~~~~~
本人に連絡を取ったらあっさり使用許可をいただけました。
手順はこう。MNISTで大量の数字データを機械に読み込ませ、読み込んだ数字からそれぞれの数字の特徴を機械が把握します。次に書かれた字を読み込んで、その字の特徴から数字を特定するといった手順になります。
MNISTとは手書きの数字の画像60000枚(!?)と10000枚(!?)のテスト用の画像セットでございます。
大量のデータをもとに字を判別してもらいます。
環境
使ったのはSurface Pro2、6年前に中古で買いました。
ソフトはペイント。
キャンバスの設定は上の通り。
それでは実際にやってみようと思います。
僕の1でございます。
これを読み込ませると
The computer guesses that this figure is " 1 "!
やったわ。
試しに動いたので判別してもらいましょう。数字は0から順に9まで読み込ませます。読み込ませた画像は以下の通り。
結果はこちら!
The computer guesses that this figure is " 0 "!
The computer guesses that this figure is " 1 "!
The computer guesses that this figure is " 2 "!
The computer guesses that this figure is " 3 "!
The computer guesses that this figure is " 4 "!
The computer guesses that this figure is " 1 "!
The computer guesses that this figure is " 6 "!
The computer guesses that this figure is " 7 "!
The computer guesses that this figure is " 8 "!
The computer guesses that this figure is " 9 "!
正答率90%の1問ミス、すご!字がそんなに汚くないと判断してくれました。うれしい。
間違えた字はこちら
1と間違えたそうです、確かに1っぽい・・・。
逆さにしたらチンアナゴになりました。
では比較対象でメイリオと正答率を比較してみましょう。
大きさは190です。
では実際に機械に判定してもらいます。
The computer guesses that this figure is " 0 "!
The computer guesses that this figure is " 1 "!
The computer guesses that this figure is " 7 "!
The computer guesses that this figure is " 3 "!
The computer guesses that this figure is " 2 "!
The computer guesses that this figure is " 5 "!
The computer guesses that this figure is " 8 "!
The computer guesses that this figure is " 7 "!
The computer guesses that this figure is " 8 "!
The computer guesses that this figure is " 6 "!
正答率60%。
俺の勝ち、なんで負けたか明日までに考えてきてください。
恐らく字が太い(学習データは字が細い)からだと推測します。
とはいえどこまで汚くしても認識できるか非常に気になります。
どこまで汚くできるか?
自分は薬物中毒者と勘違いする
薬物をしていると手の痙攣が止まらないと保険の授業で習いました。
俺は薬物使用者、俺は薬物使用者、俺は薬物使用者、俺は薬物使用者、俺は薬物使用者、俺は薬物使用者
よし。読み込ませた画像は以下の通り。
デスメタルのバンドのロゴでありそう・・・。
結果はこちら
The computer guesses that this figure is " 0 "!
The computer guesses that this figure is " 1 "!
The computer guesses that this figure is " 2 "!
The computer guesses that this figure is " 2 "!
The computer guesses that this figure is " 4 "!
The computer guesses that this figure is " 5 "!
The computer guesses that this figure is " 6 "!
The computer guesses that this figure is " 7 "!
The computer guesses that this figure is " 4 "!
The computer guesses that this figure is " 7 "!
正答率は70%、やっぱり落ちますね。とは言えきちんと機械は識別してくれました。
間違えた字は以下の通り。
かくなる上は
徹底的に疲れてみる
向かったのはボルタリング施設。
この一年二回も無職になり、立ちはだかる大きな壁、乗り越えてみせよう。
ここで指と腕を疲れさせて書いた字は自分にしか解読できない次世代の暗号技術となるはずです。
A FEW MOMENTS LATER
ヌゥン!ヘッ!ヘッ!ア゛ア゛ア゛ア゛ァ゛ァ゛ァ゛ァ゛
ア゛↑ア゛↑ア゛↑ア゛↑ア゛ア゛ア゛ァ゛ァ゛ァ゛ァ゛!!!!
ウ゛ア゛ア゛ア゛ア゛ア゛ア゛ァ゛ァ゛ァ゛ァ゛ァ゛ァ゛ァ!!!!!
たまる乳酸、 H2SO4は硫酸。
もう限界・・・。
いい感じに疲れたので持ってきたSurfaceに字をぶち込みます。
思ったより普通・・・。 結果はこちら
The computer guesses that this figure is " 1 "!
The computer guesses that this figure is " 1 "!
The computer guesses that this figure is " 2 "!
The computer guesses that this figure is " 7 "!
The computer guesses that this figure is " 4 "!
The computer guesses that this figure is " 5 "!
The computer guesses that this figure is " 6 "!
The computer guesses that this figure is " 7 "!
The computer guesses that this figure is " 1 "!
The computer guesses that this figure is " 9 "!
正答率70%でした。って手を震わせた時と同じ・・・。
間違えた字は以下の通り。
ってなわけで結論です。
ボルタリングをした後は機械曰く薬物中毒者と思い込むぐらい字が下手になる。
そんな今日は僕の25歳の誕生日です・・・間に合った。誕生日プレゼントは筋肉痛でした。
ではまた!