TMIC: App Inventor Extension for the Deployment of Image Classification Models Exported from Teachable Machine

TMIC is an App Inventor extension for the deployment of ML models for image classification developed with Google Teachable Machine in educational settings.
Google Teachable Machine is an intuitive visual tool that provides workflow-oriented support for the development of ML models for image classification. Aiming at the usage of models developed with Google Teachable Machine, the extension TMIC enables the deployment of the trained models as part of App Inventor, one of the most popular block-based programming environments for teaching computing in K-12.

The extension TMIC enables the import of ML models created with Google Teachable Machine and exported as Tensorflow.js uploaded on Google Cloud. It allows running the trained models on Google Cloud into the App Inventor app, and capturing images with the device’s rear-facing camera.

The extension is based on the PIC extension, which enables the deployment of ML models created with the PIC web application. It includes the following properties and blocks:

  UrlModel is the property responsible for containing the URL of the model trained with the Google Teachable Machine that has been exported as TensorFlow.js on Google Cloud.
WebViewer is the property that allows the user to assign a Web Browser component so that the extension can be used. The Web Browser component is used in order to visualize the functionality of the extension.
The ClassifierReady event block is executed when the extension finishes loading the ML model from the GTM cloud.
The GotClassification event block is executed when the extension finishes classifying an image. This event occurs right after the execution of the ClassifyVideoData block, returning the list of predictions for each category in the model.
The ClassifyVideoData block starts the classification of the image captured by the smartphone’s rear-facing camera video stream, using the WebViewer component. When the classification is finished, the result is returned via the GotClassification event block.
  The StopWebcam block stops the webcam when leaving the screen in which the image classification is done.
The UrlModel adjustment block allows the user to adjust the ML model URL to another link of the exported GTM model in Google Cloud.
The TeachableMachineImageClassifier get block returns a specific instance of the extension.

The extension can be used for teaching ML in K-12, in introductory courses in higher education or by anyone who aims to create “intelligent” apps for image classification.

The extension was created with the App Inventor extension framework and is available under the BSD 3 license and it is included with a LICENSE file.

Available material:

   

 

The extension is being developed by the initiative Computação na Escola of the Department of Informatics and Statistics of the Federal University of Santa Catarina/Brazil as part of a research effort aiming at introducing AI education in K-12.

F. Pereira de Oliveira, C. Gresse von Wangenheim, J. C. R. Hauck. TMIC: App Inventor Extension for the Deployment of Image Classification Models Exported from Teachable Machine. arXiv, 2022.

We would love to see the apps you create with this extension! Share the apps using the hashtag #cneufsc