{"id":7174,"date":"2019-08-26T19:26:41","date_gmt":"2019-08-26T17:26:41","guid":{"rendered":"https:\/\/blog.mi.hdm-stuttgart.de\/?p=7174"},"modified":"2023-06-18T18:23:42","modified_gmt":"2023-06-18T16:23:42","slug":"how-to-recognize-doodles-in-the-cloud","status":"publish","type":"post","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/26\/how-to-recognize-doodles-in-the-cloud\/","title":{"rendered":"How to Train a Doodle Image Classifier and Recognize Doodles in the Cloud"},"content":{"rendered":"\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"7180\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/26\/how-to-recognize-doodles-in-the-cloud\/ai\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/ai.jpg\" data-orig-size=\"1280,853\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ai\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/ai-1024x682.jpg\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/ai-1024x682.jpg\" alt=\"\" class=\"wp-image-7180\" width=\"645\" height=\"429\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/ai-1024x682.jpg 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/ai-300x200.jpg 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/ai-768x512.jpg 768w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/ai.jpg 1280w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/figure>\n\n\n\n<p>As part of the lecture \u201cSoftware Development for Cloud Computing\u201d we developed a doodle image recognition game. The idea came to us when we were searching for possible mini-games for our semester project &#8220;Peers \u2013 The Party&#8221;, an iOS app using Apple&#8217;s MultipeerConnectivity framework. <\/p>\n\n\n\n<!--more-->\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Many people don\u2019t realize that the story of today\u2019s applied AI is actually   a story about the cloud. <\/p><cite>Cassie Kozyrkov (Chief Decision Intelligence Engineer, Google) [1]<\/cite><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Goal<\/h2>\n\n\n\n<p>During our research, we found Google&#8217;s &#8220;Quick, Draw!&#8221; [2] which was basically what we wanted to achieve. The game principle is quite simple: The player gets shown a word and has to draw it within a certain time. He wins if the doodle can be recognized by the neural network. <\/p>\n\n\n\n<p>Luckily, Google open-sourced their huge dataset [3] of 50 million doodles that the game is based on. So now it was time for us to think about how to train our own neural network and use it in our game. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"691\" data-attachment-id=\"7182\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/26\/how-to-recognize-doodles-in-the-cloud\/dataset\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/dataset.png\" data-orig-size=\"1912,1290\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"dataset\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/dataset-1024x691.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/dataset-1024x691.png\" alt=\"\" class=\"wp-image-7182\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/dataset-1024x691.png 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/dataset-300x202.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/dataset-768x518.png 768w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/dataset.png 1912w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Quick Look at the &#8220;Quick, Draw!&#8221; Dataset [3]<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Local Machine Learning Setup<\/h2>\n\n\n\n<p>As a first step, we wanted to set up a local training environment to later implement the same principle in the cloud. <\/p>\n\n\n\n<p>We started using Google&#8217;s <strong>TensorFlow<\/strong>, an open-source platform for machine learning, following the tutorial &#8220;Recurrent Neural Networks for Drawing Classification&#8221; [4]. For easy collaboration, we set up a shared virtual environment using <strong>Vagrant<\/strong> based on an Ubuntu image with all needed technologies (especially Python &amp; TensorFlow) installed. <\/p>\n\n\n\n<p>Some things to be aware of that we learned after making many mistakes: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>There are many <strong>versions<\/strong> of <strong>Python<\/strong> and libraries require different ones. TensorFlow for example might not be compatible with the newest version.   <\/li><li>You will most likely need dependencies. So make yourself familiar with <strong>packaging managers<\/strong> (in our case we used both Pip and     Conda) and Python <strong>environments<\/strong>. They enable you to freeze all your <strong>dependencies<\/strong> into a text file <em>requirements.txt <\/em>which will be important for cloud deployment.<\/li><li>You might want to include Keras as well. This deep-learning library is fully integrated into TensorFlow and allows you to write less code.   <\/li><li>After installing Python and TensorFlow, we struggled quite some time  because we didn&#8217;t know that TensorFlow has to be activated in the current  environment before it can be imported.   <\/li><\/ul>\n\n\n\n<p>We continued by downloading the doodling dataset and started training our own machine learning model. <\/p>\n\n\n\n<p>Unfortunately, we were all new to machine learning and did not recognize   its full complexity in the beginning, thus we quickly came to our limits. Understanding the Python code in detail turned out to be quite difficult  for us, as we have never worked with Python before either. <\/p>\n\n\n\n<p>Overcoming these struggles, we did manage to train a model with a tiny   portion of the dataset, but came to realize that training the model to   achieve a satisfying accuracy would take our computer many weeks. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Taking it to the Cloud<\/h2>\n\n\n\n<p>So now was the right time for the Cloud. As Kozyrkov said, AI and cloud   often go together since AI has to deal with huge datasets which the cloud is a good counterpart for. <\/p>\n\n\n\n<p>Since TensorFlow is home to Google, we initially thought the <strong>Google Cloud<\/strong> [7] would be the best choice for us. We did find quite helpful tutorials for using TensorFlow in combination with Google Cloud, too, which supported our idea. <\/p>\n\n\n\n<p>We were disappointed when this plan turned out to be unrealistic because   it would cost us a fortune. We did not find a way to register for an   educational Google Cloud account or without entering any credit card   information. <\/p>\n\n\n\n<p>As a consequence, we switched to <strong>IBM Cloud<\/strong> where we were provided a student account during the lecture &#8220;Software Development for Cloud Computing&#8221;. Like Google Cloud we liked the good documentation of the IBM Cloud but noticed that the community was understandably smaller which leads to less web results when searching for specific problems. We started implementing our TensorFlow training in <strong>Watson Machine Learning<\/strong> using the included tools like the Machine Learning CLI.<\/p>\n\n\n\n<p>Unfortunately, when we wanted to finalize our code and train our model    with a chosen part of the dataset, our licence expired. After a long    research, we managed to find a pre-trained model [5] trained on 20 of the    doodle items \u2013 exactly what we needed. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"534\" data-attachment-id=\"7196\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/26\/how-to-recognize-doodles-in-the-cloud\/classes-2\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/classes-1.png\" data-orig-size=\"3682,1919\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"classes\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/classes-1-1024x534.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/classes-1-1024x534.png\" alt=\"\" class=\"wp-image-7196\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/classes-1-1024x534.png 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/classes-1-300x156.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/classes-1-768x400.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>The 20 Classes the Model we Used can Recognise<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Writing a Cloud Function<\/h2>\n\n\n\n<p>The pre-trained model was using <strong>PyTorch<\/strong> [6] instead of TensorFlow which gave us the opportunity to gain experience in yet another machine learning library. PyTorch is basically Facebook&#8217;s equivalent to TensorFlow, so we did not take too long to get a hang of it. We personally preferred TensorFlow&#8217;s documentation and the community seemed bigger but PyTorch is quite common as well.<\/p>\n\n\n\n<p>As a first step, we set up everything in the Google Cloud which is quite easy using the Web Interface. We created a cloud function based on Flask. That enabled us to easily process requests and send responses through a REST API. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"516\" data-attachment-id=\"7190\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/26\/how-to-recognize-doodles-in-the-cloud\/google-cloud-3\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/google-cloud-3.png\" data-orig-size=\"2847,1436\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"google-cloud-3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/google-cloud-3-1024x516.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/google-cloud-3-1024x516.png\" alt=\"\" class=\"wp-image-7190\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/google-cloud-3-1024x516.png 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/google-cloud-3-300x151.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/google-cloud-3-768x387.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Google Cloud Web Interface<\/figcaption><\/figure>\n\n\n\n<p>After that, we adapted our local code to fit into this cloud function and added some temporary prints for debugging because we quickly noticed that debugging in the cloud can be very time consuming. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"898\" data-attachment-id=\"7197\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/26\/how-to-recognize-doodles-in-the-cloud\/cloud-function-2\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/cloud-function-1.png\" data-orig-size=\"3456,3032\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"cloud-function\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/cloud-function-1-1024x898.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/cloud-function-1-1024x898.png\" alt=\"\" class=\"wp-image-7197\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/cloud-function-1-1024x898.png 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/cloud-function-1-300x263.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/cloud-function-1-768x674.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Code of the Cloud Function<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Going one step further<\/h2>\n\n\n\n<p>After this was all working, we were thinking about further possibilities the   cloud could provide to us. We wanted to try to save the doodle images sent to our cloud function for recognition to be able to use them for improvement of our model in the future. Therefore, we created a <strong>Bucket<\/strong> [8] in the Google Cloud and added some code to our cloud function (see below). All in all, we were surprised how easy this modification was. (Of course, using the storage feature in production  would require thinking about data privacy\/GDPR.) <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"508\" data-attachment-id=\"7189\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/26\/how-to-recognize-doodles-in-the-cloud\/bucket-1\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-1.png\" data-orig-size=\"2866,1421\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"bucket-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-1-1024x508.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-1-1024x508.png\" alt=\"\" class=\"wp-image-7189\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-1-1024x508.png 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-1-300x149.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-1-768x381.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Google Cloud Bucket<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"271\" data-attachment-id=\"7198\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/26\/how-to-recognize-doodles-in-the-cloud\/bucket-2\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-2.png\" data-orig-size=\"1240,328\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"bucket\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-2-1024x271.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-2-1024x271.png\" alt=\"\" class=\"wp-image-7198\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-2-1024x271.png 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-2-300x79.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-2-768x203.png 768w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/bucket-2.png 1240w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Code to Store Images in Bucket<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Making Predictions<\/h2>\n\n\n\n<p>The final step was to finally bring the AI functionality to our iOS app which we had been developing in parallel during the semester. Thanks to Google Cloud using   Flask, we could send a simple API request and process the response,  which in Swift looks about like this: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"574\" data-attachment-id=\"7199\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/26\/how-to-recognize-doodles-in-the-cloud\/swift-api-call-2\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/swift-api-call-1.png\" data-orig-size=\"1612,904\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"swift-api-call\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/swift-api-call-1-1024x574.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/swift-api-call-1-1024x574.png\" alt=\"\" class=\"wp-image-7199\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/swift-api-call-1-1024x574.png 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/swift-api-call-1-300x168.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/swift-api-call-1-768x431.png 768w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/swift-api-call-1.png 1612w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Swift API Call of Cloud Function<\/figcaption><\/figure>\n\n\n\n<p>Now, we could play the drawing game on our iPhones and get doodle recognition predictions out of the cloud! For our semester project &#8220;Peers&#8221; mentioned in the beginning, we later adapted the gameplay to be a multiplayer mini-game but the actual game remained the same. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Looking back on this project, we often struggled with problems that we now consider to be fairly easy. We realized that machine learning is a huge topic itself but we were surprised how quickly we could take our code into the cloud. We are aware, though, that for our specific use case we could as well have made local predictions using the machine learning model \u2013 but for us the project was all about learning new technologies. <\/p>\n\n\n\n<p>In conclusion, we will probably think more often about possibilities cloud integrations could give us in future projects while being aware of   more difficulties as well. We don&#8217;t regret having taken on the topic of AI and cloud as beginners since it was very rewarding and is still relevant. So we encourage everyone who is interested in the topic to do the same. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">References and Further Reading<\/h2>\n\n\n\n<p>[1] Quote by Cassie Kozyrkov <br><a href=\"https:\/\/towardsdatascience.com\/5-bite-sized-data-science-summaries-a5afb8509353\">https:\/\/towardsdatascience.com\/5-bite-sized-data-science-summaries-a5afb8509353<\/a><\/p>\n\n\n\n<p>[2] &#8220;Quick, Draw!&#8221; Game by Google<br><a href=\"https:\/\/quickdraw.withgoogle.com\/\">https:\/\/quickdraw.withgoogle.com\/<\/a><\/p>\n\n\n\n<p>[3] &#8220;Quick, Draw!&#8221; Open Source Dataset<br><a href=\"https:\/\/github.com\/googlecreativelab\/quickdraw-dataset\">https:\/\/github.com\/googlecreativelab\/quickdraw-dataset<\/a><\/p>\n\n\n\n<p>[4] TensorFlow Machine Learning Library \u2013 Tutorial &#8220;Recurrent Neural Networks for Drawing Classification&#8221;<br><a href=\"https:\/\/www.tensorflow.org\/tutorials\/sequences\/recurrent_quickdraw\">https:\/\/www.tensorflow.org\/tutorials\/sequences\/recurrent_quickdraw<\/a><\/p>\n\n\n\n<p>[5] The Pre-Trained Model we Used<br><a href=\"https:\/\/github.com\/vietnguyen91\/QuickDraw\">https:\/\/github.com\/vietnguyen91\/QuickDraw<\/a><\/p>\n\n\n\n<p>[6] PyTorch Machine Learning Library<br><a href=\"https:\/\/pytorch.org\/get-started\/locally\/\">https:\/\/pytorch.org\/get-started\/<\/a><\/p>\n\n\n\n<p>[7] Google Cloud Functions<br><a href=\"https:\/\/cloud.google.com\/functions\/\">https:\/\/cloud.google.com\/functions\/<\/a><\/p>\n\n\n\n<p>[8] Google Cloud Buckets<br><a href=\"https:\/\/cloud.google.com\/storage\/docs\/json_api\/v1\/buckets\">https:\/\/cloud.google.com\/storage\/docs\/json_api\/v1\/buckets<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of the lecture \u201cSoftware Development for Cloud Computing\u201d we developed a doodle image recognition game. The idea came to us when we were searching for possible mini-games for our semester project &#8220;Peers \u2013 The Party&#8221;, an iOS app using Apple&#8217;s MultipeerConnectivity framework.<\/p>\n","protected":false},"author":938,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[652,120,661],"tags":[280,282,57,281,236],"ppma_author":[793],"class_list":["post-7174","post","type-post","status-publish","format-standard","hentry","category-artificial-intelligence","category-cloud-technologies","category-deep-learning","tag-google-cloud","tag-ios","tag-machine-learning","tag-pytorch","tag-tensorflow"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":11460,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2020\/09\/29\/get-car-location-using-raspberrypi-and-google-cloud-iot-core\/","url_meta":{"origin":7174,"position":0},"title":"Get car location using Raspberry Pi and Google Cloud IoT Core","author":"Simon L\u00f6bert","date":"29. September 2020","format":false,"excerpt":"Project idea Have you ever been in the situation, that you parked your car somewhere in the city and some hours later, you couldn't remember where you parked it? You may wish to have an application on your smartphone, which is able to locate your car. From this consideration, the\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/09\/grafik.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8681,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/using-googles-cloud-vision-api-to-create-a-receipt-analyzer\/","url_meta":{"origin":7174,"position":1},"title":"Using Google&#8217;s Cloud Vision API to create a Receipt Analyzer","author":"sh260","date":"31. August 2019","format":false,"excerpt":"Everyone knows the problem of keeping track of expenses. Many applications offer an overview of all expenses, but entering all data individually can be quite time-consuming. To overcome this task, we have developed SWAI, 'A Scanner with A.I.'.","rel":"","context":"In &quot;Cloud Technologies&quot;","block_context":{"text":"Cloud Technologies","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/scalable-systems\/cloud-technologies\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/grafik-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/grafik-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/grafik-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/grafik-1.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/grafik-1.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":4147,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2018\/08\/30\/using-the-power-of-google-cloud-api-a-dockerized-node-app-counting-words-in-prasentations\/","url_meta":{"origin":7174,"position":2},"title":"Using the power of google cloud API:  A dockerized node app counting words in prasentations.","author":"sd092","date":"30. August 2018","format":false,"excerpt":"For the Dev4Cloud lecture at HdM Stuttgart, we created a simple Go\/NodeJS\/React App, which helps people to keep track of often used words during presentations. In a presentation setting, most people tend to use too many fill words and to train against this, we want to introduce our presentation counter\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2018\/08\/aufbau.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2018\/08\/aufbau.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2018\/08\/aufbau.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2018\/08\/aufbau.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2018\/08\/aufbau.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2018\/08\/aufbau.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":24588,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2023\/05\/12\/cloud-gaming-quality-factors\/","url_meta":{"origin":7174,"position":3},"title":"Evaluating Cloud Gaming Services: Uncovering Key Quality Factors with Engaging Examples","author":"Milos Aleksic","date":"12. May 2023","format":false,"excerpt":"Cloud Gaming, Source: Ajjan (2019) Introduction Cloud gaming services have gained significant traction in recent years. They allow users to play high-quality games without needing powerful hardware. This technology revolutionizes the gaming industry by enabling gamers to stream games on-demand, regardless of their device's capabilities. One key benefit of cloud\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/05\/Bildschirmfoto-2023-05-12-um-13.07.19.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/05\/Bildschirmfoto-2023-05-12-um-13.07.19.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/05\/Bildschirmfoto-2023-05-12-um-13.07.19.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/05\/Bildschirmfoto-2023-05-12-um-13.07.19.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/05\/Bildschirmfoto-2023-05-12-um-13.07.19.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":7032,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/04\/how-to-create-and-integrate-a-customised-classifier-based-on-ibm-visual-recognition\/","url_meta":{"origin":7174,"position":4},"title":"How to create and integrate a customised classifier based on IBM Visual Recognition","author":"lb092","date":"4. August 2019","format":false,"excerpt":"Helga Schwaighofer \u2013 hs082 Celine Wichmann \u2013 cw089 Lea Baumg\u00e4rtner \u2013 lb092 Motivation Imagine you are having a bad day, but you don\u2019t know what to do. Your friends are not available, but you\u2019d like to have advice depending on your mood. For that case, we created the Supporting Shellfish!\u2026","rel":"","context":"In &quot;Artificial Intelligence&quot;","block_context":{"text":"Artificial Intelligence","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/artificial-intelligence\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Image1-150x150.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Image1-150x150.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Image1-150x150.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Image1-150x150.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Image1-150x150.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Image1-150x150.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":23412,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2022\/08\/22\/migration-einer-rest-api-in-die-cloud\/","url_meta":{"origin":7174,"position":5},"title":"Migration einer REST API in die Cloud","author":"Raphael Kienh\u00f6fer","date":"22. August 2022","format":false,"excerpt":"Im Rahmen der Vorlesung \"Software Development f\u00fcr Cloud Computing\" haben wir uns zum Ziel gesetzt, eine bereits bestehende REST API in die Cloud zu migrieren.","rel":"","context":"In &quot;Cloud Technologies&quot;","block_context":{"text":"Cloud Technologies","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/scalable-systems\/cloud-technologies\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2022\/08\/OnPrem.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2022\/08\/OnPrem.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2022\/08\/OnPrem.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2022\/08\/OnPrem.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"authors":[{"term_id":793,"user_id":938,"is_guest":0,"slug":"sj041","display_name":"Stephanie Jauss, Benjamin Kramser &amp; Johanna Reiting","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/3fd2a5b7a7112eeabc4aa8767758eda036327b24b88dc0155453b6f767c673cb?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts\/7174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/users\/938"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/comments?post=7174"}],"version-history":[{"count":30,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts\/7174\/revisions"}],"predecessor-version":[{"id":7300,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts\/7174\/revisions\/7300"}],"wp:attachment":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/media?parent=7174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/categories?post=7174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/tags?post=7174"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/ppma_author?post=7174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}