{"id":21091,"date":"2018-06-19T17:33:38","date_gmt":"2018-06-19T15:33:38","guid":{"rendered":"https:\/\/www.inovex.de\/blog\/?p=13116"},"modified":"2026-03-17T07:59:24","modified_gmt":"2026-03-17T06:59:24","slug":"tensorflow-mobile-android-app","status":"publish","type":"post","link":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/","title":{"rendered":"Use Your TensorFlow Mobile Model in an Android App"},"content":{"rendered":"<p>Nowadays, modern mobile devices are extremely powerful and enable new approaches. Even if it sounds like a platitude, it is\u00a0clear\u00a0that some of these approaches are very interesting and are already used in some apps. One of these approaches is machine learning. In this post we want to show how to use TensorFlow Mobile to recognize houseplants in an Android app. Using a network directly on a device has several advantages. Firstly the app can process the data offline without the need of processing power on a server or bandwidth. Secondly, no sensitive data has to be sent through the network.<!--more--><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\"><\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#Previously-on-this-blog-%E2%80%A6\" >Previously on this blog &#8230;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#Houseplant-app\" >Houseplant app<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#Getting-started\" >Getting started<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#Classifying-plants-with-TensorFlow-Mobile\" >Classifying plants with TensorFlow Mobile<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#Useful-improvements\" >Useful improvements<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#Join-us\" >Join us!<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Previously-on-this-blog-%E2%80%A6\"><\/span>Previously on this blog &#8230;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This blog post is part of a TensorFlow Mobile series. The first post <a href=\"https:\/\/www.inovex.de\/blog\/tensorflow-mobile-training-and-deploying-a-neural-network\/\">TensorFlow Mobile: Training and Deploying a Neural Network<\/a>\u00a0has focused on how to deploy a neural network and train it for our use case. In this post we&#8217;ll show how to import and integrate such a model into the app.<\/p>\n<p>So as a short summary, what happened in the previous post?<\/p>\n<ul>\n<li>We have chosen TensorFlow Mobile as solution to create the neural network. There are two reasons, why we used TensorFlow Mobile: TensorFlow Lite is still in developer preview and furthermore TensorFlow Mobile has a bigger feature set.<\/li>\n<li>With TensorFlow Mobile we trained a model to classify images of houseplants. Our model is able to distinguish between 26 different houseplants.<\/li>\n<li>This model has been further processed for mobile use.\u00a0 At the end we have an optimized model, which is available as a Protocol Buffers (protobuff) file to use in our app.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Houseplant-app\"><\/span>Houseplant app<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The job of the application is quite simple:\u00a0Recognize houseplants with Android devices using a trained TensorFlow model. To do so the application should be capable of taking a picture of the plant and then indicate which plant it is most likely.\u00a0The animated gif below shows what the end result looks like.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13344 aligncenter\" src=\"https:\/\/www.inovex.de\/wp-content\/uploads\/2018\/06\/pilea.gif\" alt=\"\" width=\"343\" height=\"610\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Getting-started\"><\/span>Getting started<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now that the goal is clear, let&#8217;s get going with the implementation. At first glance, you might think that we have to create a lot of boiler plate code to develop such an app. Fortunately, Google offers four different <a href=\"https:\/\/github.com\/tensorflow\/tensorflow\/tree\/master\/tensorflow\/examples\/android\">TensorFlow examples<\/a> for Android.\u00a0These examples are good starting points, so we don&#8217;t have to start from scratch. The <em>TF Classify<\/em> example, which uses the Android camera to classify images in real time, roughly corresponds to the requirements of our app. That is why we will build the app on top of this example.<\/p>\n<p>A disadvantage of the four TensorFlow examples is, that they are all packed into one repository. Instead of pulling the needed example out of this repository, we will rather use the more minimal repository provided for the <a href=\"https:\/\/github.com\/googlecodelabs\/tensorflow-for-poets-2\/tree\/master\/android\/tfmobile\">TensorFlow for poets<\/a> tutorial. The repository only includes the\u00a0<em>TF Classify<\/em> example and is an ideal starting point for our houseplant app.<\/p>\n<p>Once we have checked out the\u00a0<em>TF Classify\u00a0<\/em>project, the model and labels file have to be replaced with ours. These files are located in\u00a0<span class=\"lang:default highlight:0 decode:true crayon-inline\">src\/main\/assets\/graph.pb<\/span> and <span class=\"lang:default highlight:0 decode:true crayon-inline\">src\/main\/assets\/labels.txt<\/span><\/p>\n<p>Next we need to adjust the field variables in the <i>ClassifierActivity<\/i> to match our model.<\/p>\n<pre class=\"lang:java decode:true\">private static final int INPUT_SIZE = 224;\r\n\r\nprivate static final int IMAGE_MEAN = 128;\r\n\r\nprivate static final float IMAGE_STD = 128.0f;\r\n\r\nprivate static final String INPUT_NAME = \"input\";\r\n\r\nprivate static final String OUTPUT_NAME = \"final_result\";\r\n\r\nprivate static final String MODEL_FILE = \"file:\/\/\/android_asset\/graph.pb\";\r\n\r\nprivate static final String LABEL_FILE = \"file:\/\/\/android_asset\/labels.txt\";<\/pre>\n<p>We use 224 as our input size, because the ImageNet we trained in part one of this series was trained with an image size of 224 pixels. Also, it is important to set the values for the images mean and standard deviation based on the used model.<\/p>\n<p>The input and output names are the names of the input and output nodes of the model.<\/p>\n<p>If you changed the name or the location of the model and labels file you will have to change the path of the file fields as well.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Classifying-plants-with-TensorFlow-Mobile\"><\/span>Classifying plants with TensorFlow Mobile<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The classification is based on the image data received from the camera of the device. Therefore, the application is using the <a href=\"https:\/\/developer.android.com\/reference\/android\/hardware\/camera2\/CaptureRequest\">Camera2 API <\/a> from Android. The API is quite extensive, but luckily all the needed API code is packed into the abstract class <em>CameraActivity<\/em>. The class takes care of the permission handling needed for accessing the camera and is setting up the <em>CameraConnectionFragment<\/em>. This fragment handles all camera relevant configuration and also opens and closes the camera connection and the image capturing. The fragment also registers the parent activity as listener for new images.<\/p>\n<p>All the classification is handled in the <em>ClassifierActivity<\/em>\u00a0which is extending the <em>CameraActivity<\/em>. The <em>ClassifierActivity<\/em>\u00a0receives the image data through the <em>onImageAvailable\u00a0<\/em>method which is the callback method from the\u00a0<em>OnImageAvailableListener<\/em> on which the Activity has been registered by the <em>CameraConnectionFragment<\/em>.<\/p>\n<p>Whenever an image is available, the callback method is called and the <em>ClassifierActivity<\/em>\u00a0can process the image data. Then, the data is acquired from the <em>ImageReader<\/em> passed as parameter. Before the image data can be passed to a <em>Classifier<\/em> it is converted into a Bitmap. As result, the classification provides a List of <em>Recognition<\/em>s with its confidence.<\/p>\n<pre class=\"lang:java decode:true\">final List&lt;Classifier.Recognition&gt; results = classifier.recognizeImage(croppedBitmap);<\/pre>\n<p>In our case the <em>Classifier <\/em>which recognizes the image\u00a0is the\u00a0<em>TensorFlowImageClassifier.<\/em> Such a\u00a0<em>Classifier <\/em>is using the TensorFlow Android API and our model to make an assumption what is displayed in the captured image.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Useful-improvements\"><\/span>Useful improvements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The example application from Google is constantly classifying the input from the camera. Because we wanted to give the user time to position the camera, we added a capture button and only analyzed the image on click.<\/p>\n<p>Also, to improve our model in the future, we add a feature to get feedback from the user. That is why we present the top results on a separate page where the user can confirm if one of the suggestions is right. When the user confirms the result, the image is uploaded to a cloud storage. For the upload, we use <a href=\"https:\/\/firebase.google.com\/docs\/storage\/\">Firebase Cloud Storage<\/a>, because it is easy to use within Android applications. Before uploading, the image gets annotated by adding the probability result of the model to the EXIF tags. Furthermore, the images are uploaded in different folders named after the detected plants. The categorization into folders is made depending on the result confirmed by the user. These collected images can be used in the future to generate a better model. In this case, the ordering and annotations will help to filter and improve the image base. Keep in mind that you should ask the user for permission when uploading images to a cloud storage!<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Overall, it is impressive how fast and easily a model can be integrated into an Android application. The given tutorials and examples from Google are a good way to get started and learn more about using TensorFlow. When you have a model prepared and optimized for mobile, integrating it into an Android application is not a big deal. In our example the most challenging part was getting to grips with the Camera2 API. It might take some time to understand the API, because of its extensiveness.<\/p>\n<p>If you decide to use TensorFlow Lite instead of TensorFlow Mobile, as we did in this series, you should take a look at Googles\u00a0<a href=\"https:\/\/developers.google.com\/ml-kit\/\">ML Kit<\/a>. With ML Kit the whole process is getting easier: It offers an easy to understand API, you can directly upload custom models via the web interface and they even have a model updating mechanism, which doesn&#8217;t require the user to update the whole application.\u00a0Although TensorFlow Lite has a smaller feature set, if it suffices your use case, it is a great alternative and ML Kit simplifies the model handling enormously.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Join-us\"><\/span>Join us!<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Whether you&#8217;re interested in Android development or Machine Learning, take a look at our current job offers and find what best suits your interests. Join us and implement cutting edge technology in production level projects with our broad selection of customers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nowadays, modern mobile devices are extremely powerful and enable new approaches. Even if it sounds like a platitude, it is\u00a0clear\u00a0that some of these approaches are very interesting and are already used in some apps. One of these approaches is machine learning. In this post we want to show how to use TensorFlow Mobile to recognize [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":13516,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"ep_exclude_from_search":false,"footnotes":""},"tags":[509,151,218],"service":[76],"coauthors":[{"id":71,"display_name":"Simon B\u00e4chle","user_nicename":"sbaechle"}],"class_list":["post-21091","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-ai-2","tag-deep-learning","tag-model-deployment","service-artificial-intelligence"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Use Your TensorFlow Mobile Model in an Android App<\/title>\n<meta name=\"description\" content=\"In this post we&#039;ll show how to integrate machine learning, more accurately a neural network, to recognize houseplants in an Android app\u2014using TensorFlow Mobile directly on the device!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Use Your TensorFlow Mobile Model in an Android App\" \/>\n<meta property=\"og:description\" content=\"In this post we&#039;ll show how to integrate machine learning, more accurately a neural network, to recognize houseplants in an Android app\u2014using TensorFlow Mobile directly on the device!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/\" \/>\n<meta property=\"og:site_name\" content=\"inovex GmbH\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inovexde\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-19T15:33:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-17T06:59:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inovex.de\/wp-content\/uploads\/2018\/06\/android-tensorflow-mobile-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Simon B\u00e4chle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.inovex.de\/wp-content\/uploads\/2018\/06\/android-tensorflow-mobile-1-1024x576.png\" \/>\n<meta name=\"twitter:creator\" content=\"@inovexgmbh\" \/>\n<meta name=\"twitter:site\" content=\"@inovexgmbh\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Simon B\u00e4chle\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"7\u00a0Minuten\" \/>\n\t<meta name=\"twitter:label3\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data3\" content=\"Simon B\u00e4chle\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/\"},\"author\":{\"name\":\"Simon B\u00e4chle\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/person\\\/891f8a38a8856bfdbbcc3502803d7a90\"},\"headline\":\"Use Your TensorFlow Mobile Model in an Android App\",\"datePublished\":\"2018-06-19T15:33:38+00:00\",\"dateModified\":\"2026-03-17T06:59:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/\"},\"wordCount\":1286,\"commentCount\":15,\"publisher\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/android-tensorflow-mobile-1.png\",\"keywords\":[\"Ai\",\"Deep Learning\",\"Model Deployment\"],\"articleSection\":[\"Analytics\",\"Applications\",\"English Content\",\"General\"],\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/\",\"name\":\"Use Your TensorFlow Mobile Model in an Android App\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/android-tensorflow-mobile-1.png\",\"datePublished\":\"2018-06-19T15:33:38+00:00\",\"dateModified\":\"2026-03-17T06:59:24+00:00\",\"description\":\"In this post we'll show how to integrate machine learning, more accurately a neural network, to recognize houseplants in an Android app\u2014using TensorFlow Mobile directly on the device!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/android-tensorflow-mobile-1.png\",\"contentUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/android-tensorflow-mobile-1.png\",\"width\":1920,\"height\":1080,\"caption\":\"An android pointing a smartphone at a plant\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/tensorflow-mobile-android-app\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Use Your TensorFlow Mobile Model in an Android App\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#website\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/\",\"name\":\"inovex GmbH\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#organization\",\"name\":\"inovex GmbH\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/inovex-logo-16-9-1.png\",\"contentUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/inovex-logo-16-9-1.png\",\"width\":1921,\"height\":1081,\"caption\":\"inovex GmbH\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/inovexde\",\"https:\\\/\\\/x.com\\\/inovexgmbh\",\"https:\\\/\\\/www.instagram.com\\\/inovexlife\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/inovex\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UC7r66GT14hROB_RQsQBAQUQ\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/person\\\/891f8a38a8856bfdbbcc3502803d7a90\",\"name\":\"Simon B\u00e4chle\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/596b37f5d93a18d32ab753fc7a80a974e7bc4630481a4d565e432bf7aebd5c4d?s=96&d=retro&r=g22a32fc2fa1b7e50afe6c993d84cca99\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/596b37f5d93a18d32ab753fc7a80a974e7bc4630481a4d565e432bf7aebd5c4d?s=96&d=retro&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/596b37f5d93a18d32ab753fc7a80a974e7bc4630481a4d565e432bf7aebd5c4d?s=96&d=retro&r=g\",\"caption\":\"Simon B\u00e4chle\"},\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/author\\\/sbaechle\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Use Your TensorFlow Mobile Model in an Android App","description":"In this post we'll show how to integrate machine learning, more accurately a neural network, to recognize houseplants in an Android app\u2014using TensorFlow Mobile directly on the device!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/","og_locale":"de_DE","og_type":"article","og_title":"Use Your TensorFlow Mobile Model in an Android App","og_description":"In this post we'll show how to integrate machine learning, more accurately a neural network, to recognize houseplants in an Android app\u2014using TensorFlow Mobile directly on the device!","og_url":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/","og_site_name":"inovex GmbH","article_publisher":"https:\/\/www.facebook.com\/inovexde","article_published_time":"2018-06-19T15:33:38+00:00","article_modified_time":"2026-03-17T06:59:24+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2018\/06\/android-tensorflow-mobile-1.png","type":"image\/png"}],"author":"Simon B\u00e4chle","twitter_card":"summary_large_image","twitter_image":"https:\/\/www.inovex.de\/wp-content\/uploads\/2018\/06\/android-tensorflow-mobile-1-1024x576.png","twitter_creator":"@inovexgmbh","twitter_site":"@inovexgmbh","twitter_misc":{"Verfasst von":"Simon B\u00e4chle","Gesch\u00e4tzte Lesezeit":"7\u00a0Minuten","Written by":"Simon B\u00e4chle"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#article","isPartOf":{"@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/"},"author":{"name":"Simon B\u00e4chle","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/person\/891f8a38a8856bfdbbcc3502803d7a90"},"headline":"Use Your TensorFlow Mobile Model in an Android App","datePublished":"2018-06-19T15:33:38+00:00","dateModified":"2026-03-17T06:59:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/"},"wordCount":1286,"commentCount":15,"publisher":{"@id":"https:\/\/www.inovex.de\/de\/#organization"},"image":{"@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2018\/06\/android-tensorflow-mobile-1.png","keywords":["Ai","Deep Learning","Model Deployment"],"articleSection":["Analytics","Applications","English Content","General"],"inLanguage":"de","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/","url":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/","name":"Use Your TensorFlow Mobile Model in an Android App","isPartOf":{"@id":"https:\/\/www.inovex.de\/de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#primaryimage"},"image":{"@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2018\/06\/android-tensorflow-mobile-1.png","datePublished":"2018-06-19T15:33:38+00:00","dateModified":"2026-03-17T06:59:24+00:00","description":"In this post we'll show how to integrate machine learning, more accurately a neural network, to recognize houseplants in an Android app\u2014using TensorFlow Mobile directly on the device!","breadcrumb":{"@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#primaryimage","url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2018\/06\/android-tensorflow-mobile-1.png","contentUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2018\/06\/android-tensorflow-mobile-1.png","width":1920,"height":1080,"caption":"An android pointing a smartphone at a plant"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inovex.de\/de\/blog\/tensorflow-mobile-android-app\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inovex.de\/de\/"},{"@type":"ListItem","position":2,"name":"Use Your TensorFlow Mobile Model in an Android App"}]},{"@type":"WebSite","@id":"https:\/\/www.inovex.de\/de\/#website","url":"https:\/\/www.inovex.de\/de\/","name":"inovex GmbH","description":"","publisher":{"@id":"https:\/\/www.inovex.de\/de\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inovex.de\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.inovex.de\/de\/#organization","name":"inovex GmbH","url":"https:\/\/www.inovex.de\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/","url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png","contentUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png","width":1921,"height":1081,"caption":"inovex GmbH"},"image":{"@id":"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inovexde","https:\/\/x.com\/inovexgmbh","https:\/\/www.instagram.com\/inovexlife\/","https:\/\/www.linkedin.com\/company\/inovex","https:\/\/www.youtube.com\/channel\/UC7r66GT14hROB_RQsQBAQUQ"]},{"@type":"Person","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/person\/891f8a38a8856bfdbbcc3502803d7a90","name":"Simon B\u00e4chle","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/secure.gravatar.com\/avatar\/596b37f5d93a18d32ab753fc7a80a974e7bc4630481a4d565e432bf7aebd5c4d?s=96&d=retro&r=g22a32fc2fa1b7e50afe6c993d84cca99","url":"https:\/\/secure.gravatar.com\/avatar\/596b37f5d93a18d32ab753fc7a80a974e7bc4630481a4d565e432bf7aebd5c4d?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/596b37f5d93a18d32ab753fc7a80a974e7bc4630481a4d565e432bf7aebd5c4d?s=96&d=retro&r=g","caption":"Simon B\u00e4chle"},"url":"https:\/\/www.inovex.de\/de\/blog\/author\/sbaechle\/"}]}},"_links":{"self":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/21091","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/comments?post=21091"}],"version-history":[{"count":3,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/21091\/revisions"}],"predecessor-version":[{"id":66509,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/21091\/revisions\/66509"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/media\/13516"}],"wp:attachment":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/media?parent=21091"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/tags?post=21091"},{"taxonomy":"service","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/service?post=21091"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/coauthors?post=21091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}