I would like to present an overview of the environment for developing AI applications. Look at the diagram below that I created. Basically, we can develop apps in traditional programming languages. However, in recent years, a variety of tools, libraries, and frameworks are on top of it and can be developed at a much higher level. Furthermore, AI services on the cloud and APIs that can be called in various languages are available. High-performance hardware is essential for performing AI processing. Deep learning takes a lot of work to prepare the required datasets, but some systems ease it. Don't miss out on the transfer learning for efficient training using already trained models. The need to run AI apps on smartphones is also growing. Block programming environments such as MIT App Inventor support this.
I am a professor emeritus of CS at Kanagawa Institute of Technology, Japan. Originally my specialty was parallel and distributed systems. My current interests include machine learning, natural language processing, creating mobile apps with MIT App Inventor, and quantum computing. In the web version of this blog, clicking the icon on the right (a plastic sphere) will take you to the "List of Quantum Computing Articles". - Fujio Yamamoto (for e-mail, add "@ieee.org" after "yamamotof")
2020年1月16日木曜日
2020年1月1日水曜日
2重螺旋に描いた「行く年来る年」
明けましておめでとうございます。
■新年にあたって作成したイラスト
年末に、「行く年来る年」のイラストを何か作りたいと考えました。思い付いたのが、サボテン等に見られる2重螺旋の利用です。さっそくですが、その小作品をご覧下さい。マルチエージェントモデリング用のNetLogo3D[1]を利用して作成しました。下図のとおり、令和元年(2019年)は、螺旋に沿って何処かへ引き込まれ去って行きます。さようなら、その節はお世話になりました。一方、新年令和2年(2020年)は、中央から力強く外へ進出しようとしています。私もこうなりたいものです。
■サボテンの2重螺旋の利用
ところで、上図では、矢印を示してあるので、時計回りの螺旋(中心へ向かうものと出てくるもの)が確認できます。しかし、よく目を凝らしていると、それらとは別の(反時計回り)螺旋も見えてきませんか?実は、このイラストは、下図に示すサボテンの2重螺旋[2]の上に2019年と2020年を載せたものなのです。実際、左右の図の螺旋構造は同一であり、両者の違いは見せ方にあります。サボテンを上から見た場合に中心から外へ向かう方向で突起を辿ると、時計回りに8本、反時計回りに13本の螺旋が確認できます。8と13は、生物界によく出現するフィボナッチ数列の部分列であることも知られています。これらは、学校の理科に出てきたはずですが、大人になるとほとんど忘れているようです。
■2重螺旋をAIで認識
次に思い付いたことは、AI(人工知能)は、時計回りと反時計回りの螺旋を識別(認識)できるか、ということです。しかし、上図でも矢印がなければ、両方向の螺旋が見えて交錯しそうです。そこで、方向を示す赤い小さな三角形を各要素に付して、「こちらの図では時計回りに見る」「この図では反時計回りに見る」とした多数のスクリーンショットをAIに学習させました。こんな時には、GoogleのTeachable Machine2[3]が最適です。コーディングしなくてもブラウザだけでAI実験できました。必要ならば、コーディングして、自分用にカスタマイズすることも難しくないです。
結論から言いますと、上図に示すとおり、AIにより時計回りと反時計回りの螺旋は、簡単に学習させて認識できることが分かりました。このような、誰でもサーッと使えるAIがさらに発展することを期待したいと思います。WordやExcelを使うのと同じような感覚でAIを利用できる、そんな時代になりつつあるのかも知れない。特に、言語自動翻訳はまさにそうなっており、画像認識等もその段階に入りつつあるのではないかと思います。
■雑感 - AI
本題から外れるかも知れませんが、最後にひと言。情報工学科の学生であれば、ニューラルネットワーク(誤差逆伝播法や畳み込み等を含む)の基本概念とそのプログラミングはマスターすべきでしょう。その知識が、正しい学習のさせ方と得られた結果の的確な理解に繋がることは明らかです。でも、それよりも先に、上記のTeachable Machineなどを利用してその素晴らしさを実感するのもよいでしょう。本格勉強は、それからでも遅くありません。むしろ、その体験によって勉学意欲が湧くこともあるでしょう。
参考資料
[1] NetLogo, NetLogo3D
https://ccl.northwestern.edu/netlogo/
https://ccl.northwestern.edu/netlogo/docs/3d.html
[2] サボテンに関する記事(情報工学科ブログ、2013年)
http://blog.cs.kanagawa-it.ac.jp/2013/02/netlogod.html
http://blog.cs.kanagawa-it.ac.jp/2013/01/blog-post_14.html
[3] Google Teachable Machine 2
https://teachablemachine.withgoogle.com
https://teachablemachine.withgoogle.com/faq#Saving-&-Exporting
■新年にあたって作成したイラスト
年末に、「行く年来る年」のイラストを何か作りたいと考えました。思い付いたのが、サボテン等に見られる2重螺旋の利用です。さっそくですが、その小作品をご覧下さい。マルチエージェントモデリング用のNetLogo3D[1]を利用して作成しました。下図のとおり、令和元年(2019年)は、螺旋に沿って何処かへ引き込まれ去って行きます。さようなら、その節はお世話になりました。一方、新年令和2年(2020年)は、中央から力強く外へ進出しようとしています。私もこうなりたいものです。
■サボテンの2重螺旋の利用
ところで、上図では、矢印を示してあるので、時計回りの螺旋(中心へ向かうものと出てくるもの)が確認できます。しかし、よく目を凝らしていると、それらとは別の(反時計回り)螺旋も見えてきませんか?実は、このイラストは、下図に示すサボテンの2重螺旋[2]の上に2019年と2020年を載せたものなのです。実際、左右の図の螺旋構造は同一であり、両者の違いは見せ方にあります。サボテンを上から見た場合に中心から外へ向かう方向で突起を辿ると、時計回りに8本、反時計回りに13本の螺旋が確認できます。8と13は、生物界によく出現するフィボナッチ数列の部分列であることも知られています。これらは、学校の理科に出てきたはずですが、大人になるとほとんど忘れているようです。
■2重螺旋をAIで認識
次に思い付いたことは、AI(人工知能)は、時計回りと反時計回りの螺旋を識別(認識)できるか、ということです。しかし、上図でも矢印がなければ、両方向の螺旋が見えて交錯しそうです。そこで、方向を示す赤い小さな三角形を各要素に付して、「こちらの図では時計回りに見る」「この図では反時計回りに見る」とした多数のスクリーンショットをAIに学習させました。こんな時には、GoogleのTeachable Machine2[3]が最適です。コーディングしなくてもブラウザだけでAI実験できました。必要ならば、コーディングして、自分用にカスタマイズすることも難しくないです。
An example of emphasizing a clockwise spiral
結論から言いますと、上図に示すとおり、AIにより時計回りと反時計回りの螺旋は、簡単に学習させて認識できることが分かりました。このような、誰でもサーッと使えるAIがさらに発展することを期待したいと思います。WordやExcelを使うのと同じような感覚でAIを利用できる、そんな時代になりつつあるのかも知れない。特に、言語自動翻訳はまさにそうなっており、画像認識等もその段階に入りつつあるのではないかと思います。
■雑感 - AI
本題から外れるかも知れませんが、最後にひと言。情報工学科の学生であれば、ニューラルネットワーク(誤差逆伝播法や畳み込み等を含む)の基本概念とそのプログラミングはマスターすべきでしょう。その知識が、正しい学習のさせ方と得られた結果の的確な理解に繋がることは明らかです。でも、それよりも先に、上記のTeachable Machineなどを利用してその素晴らしさを実感するのもよいでしょう。本格勉強は、それからでも遅くありません。むしろ、その体験によって勉学意欲が湧くこともあるでしょう。
参考資料
[1] NetLogo, NetLogo3D
https://ccl.northwestern.edu/netlogo/
https://ccl.northwestern.edu/netlogo/docs/3d.html
[2] サボテンに関する記事(情報工学科ブログ、2013年)
http://blog.cs.kanagawa-it.ac.jp/2013/02/netlogod.html
http://blog.cs.kanagawa-it.ac.jp/2013/01/blog-post_14.html
[3] Google Teachable Machine 2
https://teachablemachine.withgoogle.com
https://teachablemachine.withgoogle.com/faq#Saving-&-Exporting
ラベル:
double helix,
Teachable Machine,
サボテン
2019年12月20日金曜日
App Inventor version nb181 (December 19th, 2019)
MIT App Inventor is constantly upgrading, including minor improvements and bug fixes. I'd like to talk about two things that I've paid attention to in this release of "nb181". They are improved XML decoding and the addition of pressure sensor component.
XMLDecode Now Handles CDATA Sections
In XML, you may want to use markup symbols in regular strings. For example as in the following figure. However, XMLTextDecode in the XML Web component did not handle the "![CDATA [...]]" sections well. Therefore, these sections had to be removed as follows:
This issue was discussed by the community around 2015. As a countermeasure, Taifun [1] presented the above method. However, this version of App Inventor seems to have solved this problem.
Addition of Barometer
I developed several apps that use the barometric sensor built into the Android Phone and published them at the MIT App Inventor Summit 2014 [2]. At that time, App Inventor could not use the barometric pressure sensor, so I created a small Java program to get the barometric pressure value and called it with ActivityStarter.
Since then, I have used barometric pressure components [3] installed in AppyBuilder and Taifun's Extension [4]. However, with this version upgrade of App Inventor, you can use barometric pressure sensor as one of the standard sensors without using them. Great!
References
[1] Taifun's post on CDATA
https://groups.google.com/forum/#!topic/mitappinventortest/TZO5InFSIkU
[2] Fujio Yamamoto, “Rapid Prototyping Using App Inventor in Information and Computer Sciences Course”, Proc. of the MIT App Inventor Summit 2014, 3 pages, Cambridge USA, July 2014.
[3] PressureSensor by Hossein's Appy Builder
http://appybuilder.com (AppyBuilder is being integrated with Kodular)
[4] Taifun's Barometer Sensor Extension
https://puravidaapps.com/barometer.php
XMLDecode Now Handles CDATA Sections
In XML, you may want to use markup symbols in regular strings. For example as in the following figure. However, XMLTextDecode in the XML Web component did not handle the "![CDATA [...]]" sections well. Therefore, these sections had to be removed as follows:
This issue was discussed by the community around 2015. As a countermeasure, Taifun [1] presented the above method. However, this version of App Inventor seems to have solved this problem.
Addition of Barometer
I developed several apps that use the barometric sensor built into the Android Phone and published them at the MIT App Inventor Summit 2014 [2]. At that time, App Inventor could not use the barometric pressure sensor, so I created a small Java program to get the barometric pressure value and called it with ActivityStarter.
An example of an Android application using a barometer [2]
References
[1] Taifun's post on CDATA
https://groups.google.com/forum/#!topic/mitappinventortest/TZO5InFSIkU
[2] Fujio Yamamoto, “Rapid Prototyping Using App Inventor in Information and Computer Sciences Course”, Proc. of the MIT App Inventor Summit 2014, 3 pages, Cambridge USA, July 2014.
[3] PressureSensor by Hossein's Appy Builder
http://appybuilder.com (AppyBuilder is being integrated with Kodular)
[4] Taifun's Barometer Sensor Extension
https://puravidaapps.com/barometer.php
2019年12月11日水曜日
Finally arrived! Beautiful mountain photos that were automatically recognized!
In the previous article [1], I mentioned the recognition of photos from live cameras that shoot mountains. And I have developed an app that can automatically receive it by e-mail only when a photo with a clear view of the top is obtained. In order to recognize photos, I created a model in which many photos of the mountain were classified into four categories and trained. There, I used MIT's Personal Image Classifier and Google's Teachable Machine2 and incorporated the trained model into the App Inventor app.
However, in general, mountains are often covered with clouds. For example, at Rishiri Mountain in northern Hokkaido, you can see the middle but rarely see the top. So, I checked the weather forecast, and on a sunny day, I ran this app continuously from the early morning and waited for a notification email. During that time, of course, I was doing another job because it is fully automatic notification!
Finally, good luck came. It happened after 12:00 that day. As shown in Figure 1, the mountain photo was judged to be “clear enough to see the summit” and I received an automatic email to inform it. I was very happy. Sure, I got a great photo that looks good up to the top of the mountain.
References
[1] Using MIT's Personal Image Classifier with App Inventor
http://sparse-dense.blogspot.com/2019/12/using-mits-personal-image-classifier.html
However, in general, mountains are often covered with clouds. For example, at Rishiri Mountain in northern Hokkaido, you can see the middle but rarely see the top. So, I checked the weather forecast, and on a sunny day, I ran this app continuously from the early morning and waited for a notification email. During that time, of course, I was doing another job because it is fully automatic notification!
Finally, good luck came. It happened after 12:00 that day. As shown in Figure 1, the mountain photo was judged to be “clear enough to see the summit” and I received an automatic email to inform it. I was very happy. Sure, I got a great photo that looks good up to the top of the mountain.
References
[1] Using MIT's Personal Image Classifier with App Inventor
http://sparse-dense.blogspot.com/2019/12/using-mits-personal-image-classifier.html
2019年12月6日金曜日
Another example using JSON Decoding Extension
This article shows an example of using the JSON Decoding Extension I developed. Below are descriptions of this extension:
https://sparse-dense.blogspot.com/2019/01/a-json-decoding-extension-for-app.html
https://sparse-dense.blogspot.com/2019/01/a-json-decoding-extension-for-app_19.html
First of all, I would like to thank many people for their interest in this extension. In fact, these two articles have been accessed more than 1,500 times in total, but sometimes there are inquiries that they can't use it well. So here's another example that's simple but practical. It is a display of the weather forecast using OpenWeather ([1][2]). Here, the weather forecast of Sapporo City in Japan, up to five days in advance every three hours is displayed. An example of a JSON text as output from OpenWeather is shown in FIg.1. Some parts are folded in the figure, but if all are expanded, there are 1,341 lines.
In this JSON text, all the tag values shown in red frame are taken out and displayed on the smartphone as shown in FIg.2. In other words, the city name, date and time, temperature, and weather are displayed. In order to use OpenWeather in an application, it is necessary to obtain an API Key.
Here are the points of using the extension (FoYoJSON) to decode this JSON text. For example, to get the city name "Sapporo-shi", treat it like Fig.3. In addition, to retrieve all the weather forecast every three hours in order of time, write as Fig.4.
The complete source code (blocks) of this application is shown in Fig.5.

References
[1] to get OpenWeaterMap API guide:
https://openweathermap.org/guide
[2] to get City ID:
http://bulk.openweathermap.org/sample/city.list.json.gz
[3] CERCA NEL, Estrarre dati da JSON con una comoda estensione di appinventor, novembre 15, 2019
https://osmtreeathlon.blogspot.com/2019/11/estrarre-dati-da-json-con-una-comoda.html
https://sparse-dense.blogspot.com/2019/01/a-json-decoding-extension-for-app.html
https://sparse-dense.blogspot.com/2019/01/a-json-decoding-extension-for-app_19.html
First of all, I would like to thank many people for their interest in this extension. In fact, these two articles have been accessed more than 1,500 times in total, but sometimes there are inquiries that they can't use it well. So here's another example that's simple but practical. It is a display of the weather forecast using OpenWeather ([1][2]). Here, the weather forecast of Sapporo City in Japan, up to five days in advance every three hours is displayed. An example of a JSON text as output from OpenWeather is shown in FIg.1. Some parts are folded in the figure, but if all are expanded, there are 1,341 lines.
In this JSON text, all the tag values shown in red frame are taken out and displayed on the smartphone as shown in FIg.2. In other words, the city name, date and time, temperature, and weather are displayed. In order to use OpenWeather in an application, it is necessary to obtain an API Key.
Here are the points of using the extension (FoYoJSON) to decode this JSON text. For example, to get the city name "Sapporo-shi", treat it like Fig.3. In addition, to retrieve all the weather forecast every three hours in order of time, write as Fig.4.
The complete source code (blocks) of this application is shown in Fig.5.

If you take a little more time, you can create a more practical application as shown in Fig. 6, where there are four cities registered and can be switched with the button.
References
[1] to get OpenWeaterMap API guide:
https://openweathermap.org/guide
[2] to get City ID:
http://bulk.openweathermap.org/sample/city.list.json.gz
[3] CERCA NEL, Estrarre dati da JSON con una comoda estensione di appinventor, novembre 15, 2019
https://osmtreeathlon.blogspot.com/2019/11/estrarre-dati-da-json-con-una-comoda.html
ラベル:
JSON decode,
weather forecast
2019年12月1日日曜日
2019年11月27日水曜日
利尻山の画像認識をTeachable Machine2とApp Inventorで行う
前回の記事では、MIT App InventorからGoogleのTeachable Machine2を使って画像認識する例を書きました。今回、それを少し進めたアプリを作成しました。
北海道の北部にある利尻山(島全体が利尻山になっている)の状況をリアルタイムに認識するスマホアプリを作成しました。まずは、どんなものかをご紹介します。色々な造り方はあるでしょうが、ここでは、App InventorとTeachable Machine2を使って、如何に簡単に、美しい(?)AIアプリを作るかに主眼があります。何かのご参考になれば幸いです。
このアプリは、参考資料[1]に示した利尻町役場のライブカメラの画像を適宜引用して、その画像を学習させています。その学習はTeachable Machine2で行います。その学習済みモデルを使って、以下のアプリ(App Inventorによる)は動きます。
Fig.1では、現時点の利尻山のライブカメラ画像を読み込み、その画像を認識させようとしています。
他の場面の認識結果も示しておきます。Fig.3は、"曇っているが中腹は見える"場合と、"夜になり真っ暗なのでおやすみ!”の認識例です。いずれも妥当です。
学習には、Fig.4に示す4つのカテゴリを設けました。それぞれに十数枚の画像を集めて学習させました。なかでも、"Clear enough to se the top"(よく晴れていて山頂までみえる)場面になかなか出会うことができず、予想外に作業時間がかかってしまいました。
今後も、このような、比較的簡単に作成できるが、ちょっと光る(?)アプリを心がけます。
参考資料
[1] ライブカメラが掲載されている利尻町役場のホームページ
http://www.town.rishiri.hokkaido.jp/rishiri/
北海道の北部にある利尻山(島全体が利尻山になっている)の状況をリアルタイムに認識するスマホアプリを作成しました。まずは、どんなものかをご紹介します。色々な造り方はあるでしょうが、ここでは、App InventorとTeachable Machine2を使って、如何に簡単に、美しい(?)AIアプリを作るかに主眼があります。何かのご参考になれば幸いです。
このアプリは、参考資料[1]に示した利尻町役場のライブカメラの画像を適宜引用して、その画像を学習させています。その学習はTeachable Machine2で行います。その学習済みモデルを使って、以下のアプリ(App Inventorによる)は動きます。
Fig.1では、現時点の利尻山のライブカメラ画像を読み込み、その画像を認識させようとしています。
画像の認識が終わった状態が、Fig.2です。この場合の画像認識は、Fig.4に示す4つのカテゴリ(ラベル)のどれに該当するかを言うことです。この例では、幸いにも"よく晴れて山頂までみえる”という認識結果でした。間違いありません!そして、このカテゴリに該当した場合に限り、予め登録してあるメールIDあてに、この画像を添付して自動メール送信します。右側の図は、メールが届いた場面です。滅多に、"よく晴れて山頂までみえる”場面に遭遇しないので、この自動メールは有り難いはずです!
他の場面の認識結果も示しておきます。Fig.3は、"曇っているが中腹は見える"場合と、"夜になり真っ暗なのでおやすみ!”の認識例です。いずれも妥当です。
学習には、Fig.4に示す4つのカテゴリを設けました。それぞれに十数枚の画像を集めて学習させました。なかでも、"Clear enough to se the top"(よく晴れていて山頂までみえる)場面になかなか出会うことができず、予想外に作業時間がかかってしまいました。
今後も、このような、比較的簡単に作成できるが、ちょっと光る(?)アプリを心がけます。
参考資料
[1] ライブカメラが掲載されている利尻町役場のホームページ
http://www.town.rishiri.hokkaido.jp/rishiri/
2019年11月20日水曜日
MIT App InventorとGoogle Teachable Machine2を連携させる
【要旨】GoogleのAI環境Teachable Machine2を使うと、自分用に、音/画像/ ポーズの学習と認識を非常に簡単に行えますが、それだけでは、初心者レベルでに留まってしまいます。一歩進めて、自分の作りたいアプリにこれを組み入れることができれば、 世界はグンと広げられます。その糸口となる試みを、MIT AppInventorとの連携という形で行いました。
■ライブカメラ画像のリアルタイム認識の実行例
以上のとおりに作ったスマホアプリでのリアルタイム認識をやってみました。その実行例を図4に示します。学習用の画像も少なく、断定的なことは言えませんが、期待どおりの良好な結果となっています。
以上、ご参考にしていただける点があれば幸いです。
【参考情報】MIT App Inventorのフォーラム
以下でも、App InventorとTeachable Machine2に関するディスカッションがあります。私も、ひと言述べています。
Artificial Intelligence with App Inventor
https://groups.google.com/forum/#!topic/mitappinventortest/f-Hwk586hyQ
-----
先の記事に書きましたように、Teachable Machine2によれば、PCやスマホのブラウザを使って容易に自分用に(ここが重要!)、音/画像/ ポーズの学習と認識を行うことができます。子供にも大人にも、素晴らしいとAI環境と言えます。
しかしながら、自分が解きたい問題、作成したいアプリにその機能を取り込めなければ、それ以上の発展がありません。私の場合、スマホのアプリをMIT App Inventorを使って作るのですが、ここに、このTeachable Machine2を組み込めないかと思い、情報を探しましたが見当たりません。それならば、と自分で以下のようにやってみました。
■問題の設定(ライブカメラ画像のリアルタイム認識)
今回は、富士山などの山岳を望むライブカメラの画像を取得して、AI(人工知能)に、「多分、富士吉田からみた富士山でしょう」とか、「多分、夕暮れの富士山(須走)でしょう」等と、リアルタイムに認識させるアプリを作ります。
■学習用画像の収集と学習の実行
ここでは、以下の四種(4ラベル)の画像を学習/認識させます。今後種類を増やして行きますが。
- 富士山(富士吉田)
- 利尻岳(沓形)
- 昼間の富士山(須走)
- 夕暮れの富士山(須走)
収集した画像は、図1の通りです。各ラベル毎に、十数枚の画像しかなく少なすぎるのですが、とりあえずこれで進めます。これを学習させることは、先の記事のとおり容易にできますので、手順は省略します。学習済みモデルは、(デフォルトでは)Googleのサーバに置くか、または自分のPCに保存して利用することもできます。
■学習済みモデルをMIT App Inventorから使う準備
スマホ用のApp InventorにあるWebViewerというブロックは、実は強力なJavaScriptエンジンなのです。上記の学習済みモデルは、JavaScriptの環境があればどこでも動くTensorflow.jsで作られています。そのため、Googleのサーバにおいた学習済みモデルは、App Inventor側で実行できます。
しかしながら、スマホにある画像をこの学習済みモデルに与える場合、有名なクロスドメイン問題が起こるため、うまく行きません。その解決法の一つは、学習済みのモデルを、スマホのWebサーバに置くことなのです。画像も当然、このサーバにコピーしておきます。今回はこれに従いました。図2にその様子を示します。
■MIT App Inventorから学習済みモデルを動かして認識結果を得る
App Inventorから学習済みモデルを動かして認識を実行させます。図3(a)は、ライブカメラから取得した画像を、上で述べたローカルWebサーバに配置しています。図3(b)は、ローカルサーバで認識をさせ、その結果をApp Inventor側で取得しています。ここで、WebViewerのWebViewStringが受け渡しの役を担っています。■ライブカメラ画像のリアルタイム認識の実行例
以上のとおりに作ったスマホアプリでのリアルタイム認識をやってみました。その実行例を図4に示します。学習用の画像も少なく、断定的なことは言えませんが、期待どおりの良好な結果となっています。
以上、ご参考にしていただける点があれば幸いです。
【参考情報】MIT App Inventorのフォーラム
以下でも、App InventorとTeachable Machine2に関するディスカッションがあります。私も、ひと言述べています。
Artificial Intelligence with App Inventor
https://groups.google.com/forum/#!topic/mitappinventortest/f-Hwk586hyQ
2019年11月12日火曜日
スマホを音/画像/ポーズの識別器にする
先日(2019年11月初旬)に発表されたGoogleのTeachable Machine 2.0 [1]はちょっと衝撃的でした。バージョン1.0は2017年に発表されていたのですが、今回のバージョン2.0は著しく進歩しています。”Teachable Machine 2.0 makes AI easier for everyone”のキャッチフレーズの通りだと感じます。
このTeachable Machineの特徴は、ブラウザのもとで動くTensorflow.jsを使っており、学習も認識もローカルマシンできてしまうことです。学習は今のところPCでしかできないようですが、学習済みのモデルは、スマホへ組み込めるので、スマホでリアルタイムに、音/画像/ポーズの識別ができてしまいます!ここで特筆すべきは、コーディング不要であり、例えば以下のようなスマホ用の音識別器は、全体で15分くらいでできてしまうことです!
ここでは、図1に示した5つの音源を扱うことにします。(画像やポーズ認識もこの後やってみます。)
まず、ブラウザで、周辺雑音と5種類の音をスマホへ入力して(各々20秒程度)、図2の中央にあるTraining(学習)ボタンを押します。数十秒で学習が完了します。恐らく、転移学習モデルが背後にあるため、こんなに速く終わるのだと思います。次に、スマホで学習済モデルを使うために、これをexportします。
スマホ側では、この学習済みモデルのURLをブラウザから開くだけです。すなわち、これだけで、スマホが、音の識別器になってしまいました。図3と図4には、スマホに新たにテスト用入力音を与えた場合のリアルタイム識別結果を示します。5種類とも、かなり高い確度で認識に成功しています。
この学習モデルは、JavaScriptとJsonで示されているので、スマホ側で、認識結果を使った何らかのアプリケーションを作ることもできるはずです。その場合は、JavaScriptプログラミングの基礎知識などは必要になりますが。
参考資料
[1] Teachable Machine 2.0 makes AI easier for everyone
https://blog.google/technology/ai/teachable-machine/
このTeachable Machineの特徴は、ブラウザのもとで動くTensorflow.jsを使っており、学習も認識もローカルマシンできてしまうことです。学習は今のところPCでしかできないようですが、学習済みのモデルは、スマホへ組み込めるので、スマホでリアルタイムに、音/画像/ポーズの識別ができてしまいます!ここで特筆すべきは、コーディング不要であり、例えば以下のようなスマホ用の音識別器は、全体で15分くらいでできてしまうことです!
ここでは、図1に示した5つの音源を扱うことにします。(画像やポーズ認識もこの後やってみます。)
まず、ブラウザで、周辺雑音と5種類の音をスマホへ入力して(各々20秒程度)、図2の中央にあるTraining(学習)ボタンを押します。数十秒で学習が完了します。恐らく、転移学習モデルが背後にあるため、こんなに速く終わるのだと思います。次に、スマホで学習済モデルを使うために、これをexportします。
スマホ側では、この学習済みモデルのURLをブラウザから開くだけです。すなわち、これだけで、スマホが、音の識別器になってしまいました。図3と図4には、スマホに新たにテスト用入力音を与えた場合のリアルタイム識別結果を示します。5種類とも、かなり高い確度で認識に成功しています。
この学習モデルは、JavaScriptとJsonで示されているので、スマホ側で、認識結果を使った何らかのアプリケーションを作ることもできるはずです。その場合は、JavaScriptプログラミングの基礎知識などは必要になりますが。
参考資料
[1] Teachable Machine 2.0 makes AI easier for everyone
https://blog.google/technology/ai/teachable-machine/
2019年11月4日月曜日
Enjoy live cameras from across the world on your smartphone
This app has won the "2019 December's MIT APP INVENTOR OF THE MONTH" award.
http://appinventor.mit.edu/explore/app-month-winners-2019
-----
The source code (blocks) is published below:
ai2.appinventor.mit.edu/?galleryId=6239670284976128
Revision: Added a function to automatically acquire images periodically (see Fig. 4).
-----
Many live cameras are installed in cities, mountains, rivers, etc. around the world. They are useful for knowing the current situation in a nostalgic place or where an acquaintance lives. Of course, you can simply enjoy the beautiful scenery. It takes a little time to find a suitable one among those live cameras. There are not so many live cameras that are of interest to each person, at most about ten. If that's the case, don't you think it's convenient to register them in advance on your smartphone so that you can see them right away! At that time, it would be nice to be able to display the previous camera image together with the current camera image. It's often useful to know that something has changed in a few hours.
First, find out several suitable live cameras. They can be video images or still images. Also, the update interval varies from several minutes to one hour. Here, select still images with an update interval of several minutes. MIT App Inventor is very suitable for the smartphone app to be created this time.
Prepare a text file with the location name and image URL as input data. From such a text file, create a simple database with TinyDB, and through that, let the Web component get images. The acquired image is displayed with the Image component together with the current time. The saved previous image is also displayed at the same time. In addition, we added a function to automatically delete images that were not saved so as not to occupy a large amount of storage.
This is a simple app, but you can use it to see the image of the desired live camera as soon as you think of it. You can save your favorite images by pressing the button. It's also a good idea to email screenshots of current and past images to someone else.
Fig.1 shows the case where Mt. Fuji (FujiYoshida) is selected from 10 registered live cameras ([1]-[10]). It is interesting to compare this morning's image with yesterday's image.
Another examples are shown in Fig.2. Images from two live cameras (Liverpool Airport and Liverpool Waterfront) installed in Liverpool. Time is shown in Japan time. It ’s also fun to compare day and night images.


please note
If Error_908 is displayed when running this app, please allow access to External_Storage in your Android settings. Please allow it again (twice) if necessary.
http://appinventor.mit.edu/explore/app-month-winners-2019
-----
The source code (blocks) is published below:
ai2.appinventor.mit.edu/?galleryId=6239670284976128
Revision: Added a function to automatically acquire images periodically (see Fig. 4).
-----
Many live cameras are installed in cities, mountains, rivers, etc. around the world. They are useful for knowing the current situation in a nostalgic place or where an acquaintance lives. Of course, you can simply enjoy the beautiful scenery. It takes a little time to find a suitable one among those live cameras. There are not so many live cameras that are of interest to each person, at most about ten. If that's the case, don't you think it's convenient to register them in advance on your smartphone so that you can see them right away! At that time, it would be nice to be able to display the previous camera image together with the current camera image. It's often useful to know that something has changed in a few hours.
First, find out several suitable live cameras. They can be video images or still images. Also, the update interval varies from several minutes to one hour. Here, select still images with an update interval of several minutes. MIT App Inventor is very suitable for the smartphone app to be created this time.
Prepare a text file with the location name and image URL as input data. From such a text file, create a simple database with TinyDB, and through that, let the Web component get images. The acquired image is displayed with the Image component together with the current time. The saved previous image is also displayed at the same time. In addition, we added a function to automatically delete images that were not saved so as not to occupy a large amount of storage.
This is a simple app, but you can use it to see the image of the desired live camera as soon as you think of it. You can save your favorite images by pressing the button. It's also a good idea to email screenshots of current and past images to someone else.
Fig.1 shows the case where Mt. Fuji (FujiYoshida) is selected from 10 registered live cameras ([1]-[10]). It is interesting to compare this morning's image with yesterday's image.
Another examples are shown in Fig.2. Images from two live cameras (Liverpool Airport and Liverpool Waterfront) installed in Liverpool. Time is shown in Japan time. It ’s also fun to compare day and night images.

Some live cameras have a telephoto function and a variable direction shooting function. These features are switched automatically and cannot be controlled by the user, but if you are lucky you can get even better images. For example, Fig. 3 shows Mt. Fuji taken with the telephoto function and the night view of Sapporo taken from different directions.

Now we have added a function to periodically acquire images from the current Live camera. As shown in Fig.4, you can specify the shooting interval and press the button to automatically update the screen. And automatic shooting stops by Long-Click on the button.
please note
If Error_908 is displayed when running this app, please allow access to External_Storage in your Android settings. Please allow it again (twice) if necessary.
References
(The live camera URL is not shown below because some live cameras do not allow direct links to images, except for personal use.)
[1] Neuburg an der Donau
[1] Neuburg an der Donau
[2] Mt. Fuji Subashiri
[3] Sapporo Oh-dori park
[4] Liverpool AirPort
[5] Tokyo Haneda AirPort
[6] Kushiro Japan
[7] London Big Ben
[8] Mt. Fuji Fujiyoshida
[9] Liverpool Waterfront
[10] Chikuma river Naganuma
ラベル:
live camera,
MIT App Inventor
登録:
投稿 (Atom)





























