<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daryl Autar on Medium]]></title>
        <description><![CDATA[Stories by Daryl Autar on Medium]]></description>
        <link>https://medium.com/@imagine-ai?source=rss-a2db7a079636------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TyKgB8lKuPa3ggssJkkxnQ.jpeg</url>
            <title>Stories by Daryl Autar on Medium</title>
            <link>https://medium.com/@imagine-ai?source=rss-a2db7a079636------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 15:27:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@imagine-ai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[MirageGPT vs Azure’s ChatGPT for private data]]></title>
            <link>https://imagine-ai.medium.com/miragegpt-vs-azures-chatgpt-for-private-data-ef7cd2181e37?source=rss-a2db7a079636------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef7cd2181e37</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Daryl Autar]]></dc:creator>
            <pubDate>Fri, 07 Jul 2023 00:30:28 GMT</pubDate>
            <atom:updated>2023-07-07T00:31:23.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nIz2DCU8BXjV7o8zJoukDg.png" /><figcaption>This blog was made with <a href="https://www.mirage-studio.io/private_chatgpt">MirageGPT</a>…and love ❤</figcaption></figure><p><em>If you’re reading this, you already know what ChatGPT is, and are looking for a version that keeps your data private. This is exactly why we built </em><a href="https://www.mirage-studio.io/private_chatgpt"><em>MirageGPT</em></a><em>. You may have come across Microsoft Azure offering OpenAI GPT access via the API. We’ll go over the features of both, so you can choose which is right for your organization.</em></p><h4>TL;DR</h4><p>Want an easy chat interface that keeps your sensitive data private? Use MirageGPT. Want to do more complicated stuff that requires developer skills? Consider Azure’s OpenAI API service.</p><h4>Platform features</h4><ul><li><strong>MirageGPT’s Chat UI vs Azure OpenAI API</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qnd-otLFK4Wgouq2mfzvNA.png" /></figure><p>Mirage Studio offers MirageGPT through a chatbot user interface where you can ask questions and get answers. It’s familiar and requires no additional developer skills. Azure’s OpenAI Service let’s you call the code behind ChatGPT via their API. However, the data gets processed on one of their servers instead of OpenAI’s. The obvious difference here is the developer expertise required to use either. Whereas Azure OpenAI Service is only usable by developers that know how to operate APIs, MirageGPT is easy to use for everyone who knows how to type in a chat interface.</p><ul><li><strong>MirageGPT’s knowledge bases vs Azure’s CLI prompt uploads</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cTq_vI8ZT-ZKl4ZinQI0dg.png" /></figure><p>Ever used ChatGPT where you had to paste large text in smaller blocks into the chat, just so the AI could use it as context to answer your question? Us too, and we figured we make it easier with MirageGPT. Our Knowledge Base allows you to create your own knowledge bases, filled with your internal documents. You can then ask questions and let MirageGPT write texts, based on your own Financial Reports, HR policy documents, presentations, emails etc.. With Azure’s OpenAI Service, you still need to paste in the larger text in smaller blocks, but via multiple API calls.</p><ul><li><strong>Right to be forgotten</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*w4UaZFA2oVaqGaWfGhtGeQ.png" /></figure><p>We have delete buttons in MirageGPT. If you click them, gone means gone, forever. Unlike with Azure’s data centers, there are no backups that still have your data for a while after ‘deletion’. So we cannot recover your deleted data for you either. It may sound scary, but it’s a surefire way to give you 100% control over your data. You can always export your conversations to import them at a later time though. It’s not just about destroying data beyond recovery, again it’s about you being in control.</p><h4>Privacy and Compliance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*22UZoRg2_g9-MGhmi7Ci9w.png" /></figure><p>Both MirageGPT and Azure offer cloud based solutions. If you conduct business in the EU, your data privacy officers and auditors will tell you that you have to comply with GDPR. This is where it gets tricky. The major challenge lies in the differences between the EU General Data Protection Regulation (GDPR) and U.S. legislation like the Cloud Act and the Freedom Act. GDPR places strict restrictions on the collection, storage, and transfer of personal data (especially outside of the EU). However, the Cloud Act and the Freedom Act allow US law enforcement agencies to request access even to <em>non-US</em> <em>citizen</em> data held by US tech companies abroad. This means that even when all your information is stored and processed on EU servers owned by a US company, there is a risk of your data being accessed. This is why with MirageGPT, we are hosted on OVH Cloud which is a France owned cloud provider. This eliminates the risk of having cloud data in the EU accessed by US parties.</p><h4>Security and Control</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*6j292wrkWrcyXDMbaZ4oLA.png" /></figure><p>For organizations in highly confidential industries, such as semiconductors, information security officers will tell you that cloud hosting is not even an option. For these customers we offer a version of MirageGPT that can be locally hosted. We offer the choice of installing on the company’s data center or on hardware provided by us (basically MirageGPT-in-a-box). With local hosting no data ever leaves the company premises, which gives you 100% control over your sensitive data. By hosting MirageGPT locally, organizations can ensure compliance with relevant regulations and eliminate the risk of unauthorized access to data. Self-hosting on premises eliminates the risk of data breaches and unauthorized access to data. With Azure’s GPT APIs you are always required to be connected to the internet and communicate with their servers. You are unable to host it offline on your own physical hardware inside a data center that you have in full control.</p><h4>Summary</h4><p>Based on the comparison between MirageGPT and Azure’s ChatGPT API Service, MirageGPT appears to be more suitable for organizations seeking greater control over their data and ensuring its privacy. Some key advantages of MirageGPT include its ease of use, ability to self-host locally, and support for custom knowledge bases. Additionally, MirageGPT provides users with a ‘delete data permanently’ button without any delay. On the other hand, Azure’s ChatGPT API relies heavily on external services and lacks some of the advanced features offered by MirageGPT. Ultimately, the decision between the two platforms depends on the specific needs and requirements of each organization.</p><h4>Sources</h4><ul><li><a href="https://philippe-anel.fr/en/articles/2019-02-28_security-matters-for-your-data-too/">Cloud Act, Patriot Act, GDPR</a></li><li><a href="https://learn.microsoft.com/en-us/azure/cognitive-services/openai/chatgpt-quickstart?tabs=command-line&amp;pivots=programming-language-studio">Quickstart - Get started using ChatGPT and GPT-4 with Azure OpenAI Service - Azure OpenAI Service</a></li><li><a href="https://www.mirage-studio.io/private_chatgpt">MirageGPT - The private privacy-first ChatGPT alternative</a></li><li><a href="https://iapp.org/news/a/german-report-details-eu-gdpr-compliance-issues-for-microsoft-365/">German report details EU GDPR compliance issues for Microsoft 365</a></li><li><a href="https://gizmodo.com/google-says-itll-scrape-everything-you-post-online-for-1850601486">Google Says It&#39;ll Scrape Everything You Post Online for AI</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef7cd2181e37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MirageGPT by Mirage-Studio.io: The GDPR-Compliant Alternative to ChatGPT Ensuring Data Privacy]]></title>
            <link>https://imagine-ai.medium.com/miragegpt-by-mirage-studio-io-the-gdpr-compliant-alternative-to-chatgpt-ensuring-data-privacy-40e2c69ba4b0?source=rss-a2db7a079636------2</link>
            <guid isPermaLink="false">https://medium.com/p/40e2c69ba4b0</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Daryl Autar]]></dc:creator>
            <pubDate>Sat, 10 Jun 2023 00:00:47 GMT</pubDate>
            <atom:updated>2023-06-10T00:00:47.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x2pH1Czi_EZ6l8jNr0iavQ.png" /><figcaption>Check out the page at https://mirage-studio.io/private_chatgpt</figcaption></figure><p><em>Hey reader, just a heads up — I’m part of the dynamic duo behind MirageGPT. So, fair warning, I might be a tad biased when I talk about our creation — MirageGPT. Now that we’ve got that clear, buckle up for an enlightening journey into the world of privacy-first, GDPR-compliant language models!</em></p><h4>The Risks of Third-party AIs</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vB4H3qC1ow4cIGgVVzG3zg.png" /><figcaption>Data leak risk using ChatGPT</figcaption></figure><p>Data leaks are a significant risk when using third-party AI solutions like ChatGPT and Google Bard. Case in point, an incident where Samsung employees unintentionally shared confidential information with ChatGPT, resulting in a notable data breach. Even tech giant Apple restricted its employees from using AI tools like ChatGPT, fearing leakage or unauthorized collection of confidential information. Similar restrictions have been observed at other industry leaders such as JP Morgan, Verizon, and Amazon, emphasizing the seriousness of this issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8yzTEkC5mRMqZNQexEWo-A.png" /><figcaption>Compliance with Data Privacy Regulations</figcaption></figure><p>AI tools like OpenAI’s ChatGPT have come under the microscope because they might not align well with privacy laws like the GDPR. There’s a particular concern for businesses in Europe when it comes to US services. The US has laws like the Patriot Act and the FREEDOM Act that can force companies to share stored user data with US government agencies. This could go against the privacy rules set by the GDPR.</p><p>The European Union, renowned for its strict data protection standards, is at the forefront of establishing robust AI governance. It urges the AI industry to adopt a voluntary code of conduct as an immediate safeguard while new laws are being developed. Several EU countries, including France, Italy, and Spain, are investigating potential data privacy breaches related to AI tools such as ChatGPT.</p><p>Meanwhile, beyond the EU, countries such as Australia, China, Japan, and the U.S. are also working on or considering regulations for ChatGPT. These global concerns further underscore the urgent need for a solution that prioritize data privacy and ownership norms.</p><h4>Enter MirageGPT</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x2pH1Czi_EZ6l8jNr0iavQ.png" /></figure><p>MirageGPT is specifically crafted as a business-safe alternative to existing platforms like ChatGPT. While OpenAI haspaved the way for advancements in language model technologies, they also present a potentially unsettling caveat — the use of user input for model improvement.</p><p>In contrast, MirageGPT prioritizes user privacy and data ownership. We provide an environment where data remains private. No information from interactions with MirageGPT is ever used for training or any other purposes. It’s a fresh approach that puts the control firmly back in your hands. MirageGPT keeps your business’s secrets just that — secret.</p><p>To address the risk of your data leaving the EU without your consent, we offer several hosting options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YHLhz8aMoT8zkT2_Uj1sfg.png" /></figure><ul><li>Business Cloud and Enterprise Cloud: hosted on our cloud partner OVH, which is France owned and hosted.</li><li>Enterprise on-premises self-hosted: MirageGPT configured to run in your own existing cloud environment</li><li>Enterprise on-premises local: If your data is not even allowed to leave your company’s physical perimeter: this version of MirageGPT runs on a physical server on your company premises.</li></ul><p>This ensures that the data remains within the jurisdiction that best fits your business needs and within GDPR regulations, completely sidestepping issues associated with data transfers across borders.</p><h4>But wait there’s more!</h4><p>MirageGPT isn’t just a data privacy focused alternative to ChatGPT, we offer business focused features, such as a (vector) knowledge base. This allows you to collaborate with MirageGPT on your internal pdfs, word files etc.. But this is just the tip of the iceberg. Look out for our next blog post where we dive into the world of possibilities unlocked by these features. From customer service to content creation and more, stay tuned to learn about how MirageGPT is reshaping the AI landscape!</p><h4>Get in Touch</h4><p>If you’re interested in learning more about MirageGPT, visit <a href="https://mirage-studio.io/private_chatgpt">https://mirage-studio.io/private_chatgpt</a> and our team is just one click away! Reach out to us through <a href="http://support@mirage-studio.io/">support@mirage-studio.io</a>. I can’t wait to hear from you, and I’m eager to show you what more our platform has to offer. Let’s make data privacy not just an improvement point in your Information Security notes, but a reality!</p><h4>Sources</h4><ul><li><a href="https://mirage-studio.io/private_chatgpt">MirageGPT - The privacy-first ChatGPT alternative</a></li><li><a href="https://mirage-studio.io/">Mirage Studio - Gratis Nederlandse ChatGPT-detector</a></li><li><a href="https://mashable.com/article/samsung-chatgpt-leak-details">Whoops, Samsung workers accidentally leaked trade secrets via ChatGPT</a></li><li><a href="https://www.theverge.com/2023/5/19/23729619/apple-bans-chatgpt-openai-fears-data-leak">Apple restricts employees from using ChatGPT over fear of data leaks</a></li><li><a href="https://www.reuters.com/technology/governments-efforts-regulate-ai-tools-2023-04-12/">Factbox: Governments race to regulate AI tools</a></li><li><a href="https://economictimes.indiatimes.com/tech/technology/dutch-privacy-watchdog-seeks-information-from-openai-flags-concerns/articleshow/100828799.cms">Dutch privacy watchdog seeks information from OpenAI, flags concerns</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40e2c69ba4b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I caught a Pikachu in my Samsung Galaxy Z Flip 3 Pokéball and so can you :D]]></title>
            <link>https://imagine-ai.medium.com/i-caught-a-pikachu-in-my-samsung-galaxy-z-flip-3-pok%C3%A9ball-and-so-can-you-d-a053d0f86c81?source=rss-a2db7a079636------2</link>
            <guid isPermaLink="false">https://medium.com/p/a053d0f86c81</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[samsung]]></category>
            <category><![CDATA[pokemon]]></category>
            <category><![CDATA[galaxy-z-flip-3]]></category>
            <dc:creator><![CDATA[Daryl Autar]]></dc:creator>
            <pubDate>Sun, 12 Feb 2023 23:57:17 GMT</pubDate>
            <atom:updated>2023-02-12T23:57:17.083Z</atom:updated>
            <content:encoded><![CDATA[<h3>I caught a Pikachu in my Samsung Galaxy Z Flip 3 Pokéball and so can you :D</h3><h4><em>If you didn’t have a stroke trying to make sense of the title, this one’s for you! This article is quite light on AI content compared to usual, but I was going through some stuff and Pokémon still puts a smile on my face 23+ years down the road.</em></h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWLoSMK3CGSI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWLoSMK3CGSI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWLoSMK3CGSI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9eedc85acd514c76c5b65c40943c3fa/href">https://medium.com/media/a9eedc85acd514c76c5b65c40943c3fa/href</a></iframe><p>I know delayed gratification isn’t a thing anymore thanks to social media, <a href="https://drive.google.com/drive/folders/1dJ8uklK9UQAuJ_6BThshWK3OWhhLcNkE?usp=sharing">so here’s the download link to the free Z Flip theme</a> for those who aren’t interested in the how. Otherwise, do keep reading :)</p><p>If you, like me, are also disappointed to keep missing out on the official Pokémon editions of the Samsung Z Flip phones, do I have a cool idea for you!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sC4JxMERYFan0TbleXwP3Q.png" /><figcaption>Nope, never made available here and of course immediately sold out :(</figcaption></figure><h3>Cover screen video</h3><p>I started out with this free wallpaper (free for non-commercial use!) and cropped it to the default cover screen size: 260x512 pixels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f9hGL0f9I_OjWkfDXLkTwQ.jpeg" /><figcaption><a href="https://wallpaperaccess.com/pikachu-face">https://wallpaperaccess.com/pikachu-face</a></figcaption></figure><p>I could have left it as a static image, but I wanted to make it so that it seems as if Pikachu is actually living and doing his own thing inside our ‘Flipéball’. So to create the blinking animation, I created a new frame using <a href="https://www.gimp.org/downloads/">GIMP, which is a completely free and powerful alternative to Photoshop</a>. Sure, this could have just as easily been done in MS Paint or even Powerpoint, but those are workarounds, while GIMP is meant for this kind of image editing and available for free on Windows, Linux and MacOS. I just placed two yellow circles over the eyes, like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*3VilfoHIraM_JwR3BolDfw.png" /></figure><p>With these two simple images, if you play them after each other, it tricks your brain into perceiving this as a blinking animation, no? So the next step was to turn the two images into an animation. There are several free video editing tools out there. OpenShot and KDenLive are the two named most often. After having used both over time, I’ve slightly preferred OpenShot, because it crashed less often on my system. <a href="https://www.blender.org/download/">However, I noticed that Blender was also mentioned on listicles with free video editing software.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJnYBi1llxxGkgoe6UD2Rg.png" /></figure><p>Before then, I only knew Blender from being a powerful and the default rendering tool to create 3D assets, animations and VFX. Turns out, you can do most video editing tasks with it as well. Since I want to dive into 3D rendering in the future (stay tuned), I figured might as well use Blender and familiarize myself with it. Also, apparently Blender has a ‘Python controlled interface’, which is my go-to programming language for AI/ML of course. Might come in handy if I want to develop custom AI plugins at some point.</p><p>Anyway, after importing the two images (eyes open and eyes closed) as video frames into Blender’s video editing menu, it was a bit of fiddling to get the animation just right. When the cover screen wakes up from deep sleep, it plays the animation from the start. If the phone is already awake, it starts playing from any timestamp. So now when it plays from the start, it looks like you’re waking up a sleepy Pikachu, who falls asleep just before the screen times out again.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FB-Z81qPfWTY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DB-Z81qPfWTY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FB-Z81qPfWTY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/658d94bd6026f87849ea96d8d3312e2a/href">https://medium.com/media/658d94bd6026f87849ea96d8d3312e2a/href</a></iframe><h3>Lock screen video</h3><p>What better animation for a full screen flip phone, than the two halves of a Pokéball opening and closing? Well…I’m a lot of things, but not a graphic designer, so I was starting to run into the limits of my image editing capabilities. Instead of creating an animation from scratch, how about using existing material? Luckily, the OG Season 1 opening of Pokémon, has an animation of a Pokéball catching a Pokémon and closing. And also luckily, I have the original material…on DVD. Yep, I am that old. Anyway, here’s the original intro, try to spot the part we need.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FR4GIyJxvk94%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DR4GIyJxvk94&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FR4GIyJxvk94%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/629b35440955a10dc0de7844459e8334/href">https://medium.com/media/629b35440955a10dc0de7844459e8334/href</a></iframe><p>Alright, 2 problems with the scene at 0:28s</p><ol><li>it’s a closing animation, not opening. The idea is: open the phone, open the Pokéball. This we can fix by simply playing the closing sequence backwards in Blender. In fact, we can even create a nice open and close loop!</li><li>You youngsters are spoiled, back in my day the episodes were in 480p and we were perfectly happy with it. However, my 1080x2636 phone screen today disagrees. We’re quite a few pixels short. Just leaving it like this would stretch the pixels and make it a permanent eye-sore.</li></ol><p>AI to the the rescue! You were promised some light AI and here it finally is. AI upscaling is the term. You feed a low resolution image into an AI model, and it magically spits out a 4K (or even 8K) version of the image. It doesn’t just ‘blow up’ the animation into a blurry mess, it actually uses AI to sharpen and interpolate new pixels. So you get a 4K image that looks like it has always been that way. If you are a gamer, this concept will sound familiar. And it should, because it’s the same idea behind DLSS (Nvidia) and FSR (AMD). <a href="https://github.com/xinntao/Real-ESRGAN">For our use case, we use the tested and tried open source AI model called Real-ESRGAN</a>.</p><p>The latest version of Real-ESRGAN has an upscaler model specifically trained on anime videos, so that’s just perfect. <a href="https://colab.research.google.com/drive/1yNl9ORUxxlL4N0keJa2SEPB61imPQd1B?usp=sharing">Here’s a link to the free Google Colab for those of you not blessed with a physical Nvidia GPU</a>. (Or rather, more sensible with your money and time.)</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FoJJObyqgoxE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DoJJObyqgoxE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FoJJObyqgoxE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e38f5b5b9e913cfa1a2a81da0c5730ac/href">https://medium.com/media/e38f5b5b9e913cfa1a2a81da0c5730ac/href</a></iframe><h3>Home screen image</h3><p>Alright, time for the home stretch, I mean, home screen. For this, I wanted to make it seem as if Pikachu just jumped out of the Pokéball we opened and is ready for adventure. Easy peasy, we just take 1 frame out of the newly upscaled video and place a cheerful Pikachu in front using GIMP. <a href="https://pokemon.fandom.com/wiki/Pikachu?file=025Pikachu_OS_anime_11.png">More specifically, it’s this Pikachu which is copyrighted, but falls under a fair use policy!</a> Since this is an educational hobby project, we should be safe to use it. Just don’t be a Team Rocket hoodlum who goes and tries to use it in a commercial setting!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*O46NXNTdw_oiDeYp9l5QvA.png" /><figcaption>Let’s Go beat up some legendaries!</figcaption></figure><h3>Cherry on top</h3><p>To give it that typical Pokéball look, on the inside and out, we can put some skins on the outside in a red and white color scheme. After putting in all this effort, <a href="https://mightyskins.com/collections/samsung-z-flip-3/products/sazfl3-battle-ball">I went all in on the nerdy look and chose this one called Battle Ball.</a> However, do note that this skin is <strong>quite expensive including shipping and customs and comes up 1mm short on the red top cover</strong>. That last bit heavily triggers something inside me that is officially not diagnosed as OCD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLbthX_5hl4OQd2Q_iRfBw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*flycMoSm1rkwkWUZnDZIZg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ss7dAxlICKr09amo0eT5Qg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cltdi3RWbHf75fynx9NIkw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QdcnmjES-hQh-71zFaSYpg.jpeg" /><figcaption>Looks quite nice when you put it all together :D</figcaption></figure><p>If you want a similar look but at a much lower price and with plausible Poké-deniability, you can order <a href="https://nl.aliexpress.com/item/1005003403199725.html">a red phone skin and white phone skin for a lot less on aliexpress and combine the two</a>. I ordered and received these ones as backups, since they might go out of stock as the Flip 3 goes out of manufacturing. Make sure to select the ones for your version of the Flip 3 or Flip 4. None of this content is sponsored, and these are not affiliate links. I just ordered them for myself and would save you an evening scouring the internet, like I did.</p><p>Anyway, hope you had fun, learned a thing or two and are now ready to catch em all!</p><p><em>I take no responsibility for people throwing their newly themed Flip phones at yellow thunder mice outdoors.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a053d0f86c81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quick case study of Dall-e 2 and reproducing the real world]]></title>
            <link>https://imagine-ai.medium.com/quick-case-study-of-dall-e-2-and-reproducing-the-real-world-c155f72002fc?source=rss-a2db7a079636------2</link>
            <guid isPermaLink="false">https://medium.com/p/c155f72002fc</guid>
            <category><![CDATA[dalle-2]]></category>
            <category><![CDATA[generative-art]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Daryl Autar]]></dc:creator>
            <pubDate>Sun, 22 May 2022 23:53:31 GMT</pubDate>
            <atom:updated>2022-05-22T23:58:44.133Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="AI generated image of Rotterdam by Dall-e 2 from OpenAI" src="https://cdn-images-1.medium.com/max/1024/0*U9kx_nXmUFi50rDN" /><figcaption>Ceci n’est pas Rotterdam</figcaption></figure><p><em>Most people will scroll past quickly, assume the above is a photo of Rotterdam and carry on with their day. But you’re not most people :) Look closer and you’ll notice things are off. The ‘photo’ was generated by Dall-e 2: the text to image generator that has everyone in AI hyped up and everyone in creative roles fearing for their jobs.</em></p><p>The text prompt given to Dall-e 2 to generate photos was: <strong><em>“Tilt shift aerial view of Rotterdam city during summer anno 2020”</em></strong></p><p>In this writeup, I’ll go over the elements of the text prompt one-by-one and evaluate how well Dall-e 2 was able to deliver it.</p><p><strong>Overall impression of how well it was able to draw Rotterdam from memory</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*zNEjGlldicczSX3F68dodQ.png" /><figcaption>Reference image of Rotterdam in 2015 from a roughly similar angle, cropped from source: <a href="https://commons.wikimedia.org/wiki/File:Rotterdam_Blick_vom_Euromast_auf_Kop_van_Zuid_1.jpg">https://commons.wikimedia.org/wiki/File:Rotterdam_Blick_vom_Euromast_auf_Kop_van_Zuid_1.jpg</a></figcaption></figure><p><strong>What it got right</strong></p><p>I have to say, I am quite impressed that it was able to generate the 2 main landmarks: the Erasmus bridge (aka the Swan) and the ‘de Rotterdam’ tower (weird geometric shaped building). Also in terms of positioning, it knows the bridge goes on the water, and tower goes across the river.</p><p><strong>What it got wrong</strong></p><p>It knows the overall shape of buildings, but it’s quite bad at the details, such as windows. Also, most other buildings/towers are just randomly placed here and there and given random textures. It sees the Erasmus bridge as an independent building-structure that does not necessarily need to be connected to roads. Interesting result, since from looking at the roads in the photo, Dall-e 2 does seem to understand the concept of roads leading to somewhere. It just discontinues them as soon as they are occulted by other objects. Object permanence seems to be a bit of a challenge.</p><p><strong>Breakdown of the other text prompt elements</strong></p><p><em>Tilt shift</em>: I wanted to compare it with a tilt shift filter from photo editing apps like Instagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vWr_Nfaco6zq-GZSOCZvaA.png" /><figcaption>Instagram tilt shift edited reference image of Rotterdam from a roughly similar angle, cropped from source: <a href="https://commons.wikimedia.org/wiki/File:Rotterdam_Blick_vom_Euromast_auf_Kop_van_Zuid_1.jpg">https://commons.wikimedia.org/wiki/File:Rotterdam_Blick_vom_Euromast_auf_Kop_van_Zuid_1.jpg</a></figcaption></figure><p>I don’t see a clear winner between Dall-e 2 and Instagram, both look just meh. In the Instagram version, it has to do with the sharpness of the input image and the perspective. I’ve seen the Instagram filter produce <a href="https://www.cnet.com/culture/how-to-use-the-tilt-shift-effect-on-instagram-for-android/">way better results.</a> Then again, here’s a better result from <a href="https://twitter.com/Merzmensch/status/1525227446089416705/photo/2">Dall-e 2 on a different tilt shift prompt as well</a>.</p><p><em>Aerial view</em>: I expected it to be zoomed out more, like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*_tgGGctBiN2Smv47" /><figcaption>Aerial view of Windhoek, Namibia, Brian McMorrow, CC BY-SA 2.5, via Wikimedia Commons <a href="https://commons.wikimedia.org/wiki/File:Windhoek_aerial.jpg">https://commons.wikimedia.org/wiki/File:Windhoek_aerial.jpg</a></figcaption></figure><p>The above is a typical aerial view photo perspective. It’s clearly taken from high up in the sky. Dall-e 2 only generated a view from closer to the ground, which is not what we usually mean with the term ‘aerial view’. This could imply that Dall-e 2 either hasn’t seen many aerial view perspective photos in training. Another more likely explanation could be that it has seen those type of photos, but does not associate them with the label ‘aerial view’.</p><p><em>Summer:</em> The generated photos look sunny indeed. Take a look at the generated photo below. Buildings even have darker parts consistently on one side to indicate shade being thrown from a light source. Also, there’s even reflections generated in the water for the larger structures!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0eNmx9fIe303Xsd1" /><figcaption>Dall-e 2 generated result of Rotterdam #2</figcaption></figure><p><em>Anno 2020</em>: I chose 2020 because at that time the Zalmhaven tower (a 70-story skyscraper) was being built. I wanted to judge the ability of the model to discern time consistency. We could verify this if the photos showed the Zalmhaven tower under construction. (If the building is completely missing: 2017 or earlier. If the building is shown fully completed: 2022.) Alas, it’s hard to judge if the tower is missing entirely, or whether it’s misplaced, but present with a different texture. Although this new tower is quite an icon as the largest building in the Netherlands, the AI behind Dall-e 2 is likely biased by the training data. Due to its recency, the Zalmhaven tower just has way fewer pictures of it available, so it does not prioritize its shape, color and position. (Unlike it did very well with the Erasmus bridge and the ‘de Rotterdam’.)</p><p><strong>Diversity of results</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*Nk5OuamvgJEpBoo39xODHA.png" /><figcaption>All 4 results generated by Dall-e 2, <a href="https://twitter.com/bakztfuture/status/1525285497626628097">https://twitter.com/bakztfuture/status/1525285497626628097</a></figcaption></figure><p>I usually see very diverse results for any single Dall-e 2 prompt. In this case, all 4 results seem to be taken from the same point of view and the same part of town. I expected it to return some other iconic views and landmarks as well, like Rotterdam’s Euromast tower or city center.</p><p><strong>Final thoughts</strong></p><p>The first version of Dall-e went viral in 2021, but was not accessible to check ourselves (thanks ‘Open’AI). Now with Dalle-2 they have only given access to a few lucky people, so I was very skeptical when I saw the mind-blowing results. For many of the prompts <a href="https://twitter.com/search?q=dalle2&amp;src=typed_query">making rounds on Twitter</a> it’s impossible to say whether results are generated by a human artist or Dall-e 2. <em>*conspiracy voice*</em> What if they just hired a floor with illustrators to keep the hype going?</p><p>Seeing Dall-e 2 struggle with the results from my text prompt removes any doubt whether it’s generated by an algorithm. The above photos have obvious flaws. It can surely be considered artwork, but if the job is to represent the city accurately, then it did a poor job. At the same time, I’ve spent plenty of time in Rotterdam, yet if anyone asked me to draw the city from memory, I’m sure I would not outperform Dall-e 2. In fact, my strategy would also be to spend a lot of time on the few obvious landmarks and just fill in the rest with random stuff.</p><p>Dall-e 2 is nothing short of mind-blowingly impressive for text prompts asking to generate a few objects. It does very well when not having to generate real-world accurate results. I do see room for improvement w.r.t. labeling the training data to get even better results when generating photos containing many objects. In the meantime creatives needn’t hang up their pencils yet.</p><p><strong><em>Huge shoutout to </em></strong><a href="https://twitter.com/bakztfuture/status/1525285497626628097"><strong><em>Bakz T. Future, who is one of the lucky few with access to Dall-e 2 and let me submit this prompt</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c155f72002fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I made an AI listen to 200 Ed Sheeran songs and told it to write Valentine’s Day messages]]></title>
            <link>https://imagine-ai.medium.com/i-made-an-ai-listen-to-200-ed-sheeran-songs-and-told-it-to-write-valentines-day-messages-127dc9eb4882?source=rss-a2db7a079636------2</link>
            <guid isPermaLink="false">https://medium.com/p/127dc9eb4882</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[valentines-day]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Daryl Autar]]></dc:creator>
            <pubDate>Mon, 14 Feb 2022 00:20:13 GMT</pubDate>
            <atom:updated>2022-02-14T01:10:25.327Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*zqXl7hK3y2Fr2C2wPUgYuA.png" /><figcaption>Ed Sheeran if you’re reading this, don’t hang up the guitar yet</figcaption></figure><p><strong>Nothing says “Happy Valentine’s Day, dear!” like wasting 4 hours to train an AI instead of taking 15 minutes to hand-write a thoughtful Valentine’s day message. So let’s go for it!</strong></p><p><em>Note: If you just want to try the message generator yourself, scroll to the bottom.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/0*I67xghJ8958pq42y.jpg" /><figcaption>Ed Sheeran performing at Ipswich Arts Festival 2010, Photo by Jen O’Neill</figcaption></figure><p>Some people just have a way with words (not me of course). Many people would agree that Ed Sheeran sure does! So with the recent advances in AI and natural language processing, let’s see if we can pick his brain to come up with greeting card worthy messages.</p><p>To do that, we will take an existing language model (GPT-2) and retrain it in Google Colab based on Ed’s song lyrics.</p><p><strong>Step 1, get data</strong></p><p>Data collection is usually most of the work here, when you can stand on the shoulders of Deep Learning giants for the existing model. Luckily, we don’t have to google Ed Sheeran’s most popular 200 songs and copy/paste the lyrics to a txt file. Instead, we can use the API created by the people from Genius.com, my favorite site for song lyrics. You’ll need to create your own <a href="http://genius.com/api-clients">developer account and tokens here</a>. Once you have those:</p><pre>!pip install git+https://github.com/johnwmillr/LyricsGenius.git<br>import os<br>import lyricsgenius<br>genius = lyricsgenius.Genius(&#39;enter your own token here&#39;,<br>    remove_section_headers=True,<br>    excluded_terms=[&quot;(Remix)&quot;, &quot;(Live)&quot;, &quot;(Acoustic)&quot;],<br>        timeout=15, retries=3)</pre><pre>artist = genius.search_artist(&quot;Ed Sheeran&quot;, max_songs=200,   sort=&quot;popularity&quot;)</pre><pre>file_name = &quot;ed_sheeran_lyrics.txt&quot;<br>with open(file_name, &#39;a&#39;) as f:<br>    for song in artist.songs:<br>        data = song.lyrics<br>        f.write(data)<br>f.close()</pre><p>We login to the API using our personal token and retrieve the 200 most popular songs. We exclude things like acoustic versions, because we don’t want too many duplicate lyrics polluting the data. We also exclude the headers, lest your crush get suspicious when reading words like [Intro] or [Chorus] in your beautifully personalized Valentine’s Day poem.</p><p><strong>Step 2, load and retrain GPT-2</strong></p><p>In our case, we will use GPT-2 as the pre-trained model. The reason for this model is that more recent models like GPT-J are too large to retrain on most accessible compute resources. Out of pure spite, I won’t mention that other recent not-so-open AI-model. Anyway, for GPT-2 there is a very user friendly python package called gpt-2-simple. The technical term for retraining the last part of a pre-trained model for your custom use-case is called finetuning by the way.</p><pre>!pip install -q gpt-2-simple<br>import gpt_2_simple as gpt2<br>from datetime import datetime<br>from google.colab import files<br>import os<br>import requests</pre><pre>#download the smallest pre-trained model to save time<br>gpt2.download_gpt2(model_name=&quot;124M&quot;)<br>gpt2.mount_gdrive()</pre><pre>#load the data<br>file_name = &quot;ed_sheeran_lyrics.txt&quot;<br>gpt2.copy_file_from_gdrive(file_name)</pre><pre>#finetune the model with the new data<br>sess = gpt2.start_tf_sess()<br>gpt2.finetune(sess,<br>              dataset=file_name,<br>              model_name=&#39;124M&#39;,<br>              steps=1000,<br>              restore_from=&#39;fresh&#39;,<br>              run_name=&#39;run_ed_1&#39;,<br>              print_every=10,<br>              sample_every=200,<br>              save_every=500<br>              )</pre><pre>gpt2.copy_checkpoint_to_gdrive(run_name=&#39;run_ed_1&#39;)<br>gpt2.copy_checkpoint_from_gdrive(run_name=&#39;run_ed_1&#39;)</pre><p><strong>Step 3, give it some Valentine’s day prompts to complete</strong></p><p>Now that we have our own neural network that’s trained to be a ̶h̶o̶p̶e̶l̶e̶s̶s̶ hopeful romantic, let’s give it a text prompt like <em>“To my Valentine”</em> and make it work for us:</p><pre>prefix = input(&quot;Your prompt (e.g. To my Valentine,): &quot;)<br>gpt2.generate(sess,<br>              length=50,<br>              temperature=0.7,<br>              prefix=prefix,<br>              nsamples=5,<br>              batch_size=5,<br>              run_name=&#39;run_ed_1&#39;<br>              )</pre><p>Some of us like/need to take advantage of the law of large numbers when it comes to dating, so the script generates 5 messages at a time. The results are…well not what you might’ve hoped, but exactly what you expected. Here’s an excerpt. Some are…concerning, to say the least.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*AMZM7u6b1cyI2HeSSyorFQ.png" /><figcaption>Our AI hardware might need water cooling, cause this is just thirsty</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*DUHGfp7sxtYXqkOu7gvfgw.png" /><figcaption>Nice try as long as their first love is their current love ¯\_(ツ)_/¯</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*WfP9lUUHReapt5WYsuUKoA.png" /><figcaption>Always good to remind someone you’re their only option</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*vHNbe01yB7EpWylOC5F6zQ.png" /><figcaption>Seems like AI-Ed made a pact with the devil for its fame &amp; success</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*GDsXbJUnY4mTH45eIYz5Dw.png" /><figcaption>Started so promising, but oof, that plot twist.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*ohxGqpsEHzvQnmU4vLK1mg.png" /><figcaption>It’s not all bad, there’s hope</figcaption></figure><p><strong>Lessons learned</strong></p><p>It’s been a nice exercise in creating a basic finetuning pipeline for pre-trained language models, so do go ahead and try it yourself for your own use cases. Real world use of most of the above texts could lead to a drastic update in relationship status from “in a relationship” to “it’s complicated”. There are a few straightforward ways to improve these results:</p><ol><li>improve input data quality. Garbage in is still garbage out. Ed’s lyrics are of course Genius (pun intended). But we did not put any serious effort into making sure that all lyrics put into the model are what we would find desirable output. From the output, it seems that the input lyrics included quite a few songs about heartbreaks as well.</li><li>add more data. Currently, with 200 songs, there’s only 10000 or so lines of text. So we’re currently starving the very data hungry language models. Keep in mind that newer models are trained on pretty much the entirety of the English web.</li><li>use a bigger model. We used the smallest version of the GPT-2 model because bigger ones would either take too long to train or would literally not run on our available hardware. This goes to show how power hungry language models are.</li></ol><p><strong>Try it yourself</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tPJYSmEH2CjXKstoI4jVqQ.png" /><figcaption>Google colab screenshot</figcaption></figure><p><a href="https://colab.research.google.com/drive/19_HNw-lpsEfu4BrqOb7-S5vwJFcXnLbN?usp=sharing">Here’s the code to the prediction colab</a>, give it a try if you want to generate your own messages. You can try a bunch of different input prompts and see what rolls out. If you find hilarious results, share the joy by posting them and feel free to tag me: on <a href="https://twitter.com/daryl_imagineai">Twitter</a> or <a href="https://www.linkedin.com/in/darylautar/">LinkedIn</a></p><p><strong>And of course, Happy Valentine’s Day if you made it all the way here ;)</strong></p><p><strong><em>Sources<br></em></strong><a href="https://github.com/johnwmillr/LyricsGenius"><em>LyricsGenius python API wrapper</em></a><em><br></em><a href="https://colab.research.google.com/drive/1U-XJjkjuk6M6ecOk1BFajXywSVnxeC41?usp=sharing"><em>Lyrics downloader colab code</em></a><em><br></em><a href="https://github.com/minimaxir/gpt-2-simple"><em>gpt-2-simple Python library</em></a><em> (includes a link to the original Colab by Max Woolf that I slightly adapted)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=127dc9eb4882" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ding-dong, there’s something fishy about this AI]]></title>
            <link>https://imagine-ai.medium.com/ding-dong-theres-something-fishy-about-this-ai-6d29ae4b9159?source=rss-a2db7a079636------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d29ae4b9159</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[fishing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Daryl Autar]]></dc:creator>
            <pubDate>Mon, 05 Apr 2021 23:51:41 GMT</pubDate>
            <atom:updated>2021-04-06T00:37:04.813Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ftDDsZqOndCRocIWCE49vA.gif" /><figcaption>Deep learning fish detection applied to visdeurbel.nl (fish doorbell)</figcaption></figure><p><strong>N.B. For an interactive environment to play around, scroll way down.</strong></p><p><em>“Hey Daryl, any recommendations on an easy-to-train computer vision model?”</em></p><p>It was Saturday afternoon when I received above message from <a href="https://www.linkedin.com/in/gijs-verdonschot-04340012b/">Gijs, a fellow startup founder</a>. Seems out-of-the-blue, but actually not an uncommon Saturday afternoon question working in AI. On autopilot, I immediately replied: <em>“</em><a href="https://teachablemachine.withgoogle.com/"><em>Teachable Machine</em></a><em>”</em>. This is the most user-friendly interface to train computer vision models. Seconds later I scrolled up a bit in my messages and saw the reason for the question: <a href="https://visdeurbel.nl/">visdeurbel.nl</a> (fish doorbell)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSG5HieB0rM9VD_NYDqRHg.png" /><figcaption>visdeurbel.nl screenshot (See a fish? Ring the door bell!)</figcaption></figure><p>Visdeurbel.nl is a recently launched livestream that shows whether there’s fish waiting in front of a canal lock (<em>sluis in Dutch</em>) in the City of Utrecht. When enough people watching the livestream ring the doorbell on behalf of the fish (cause, no fish fingers), the person in charge of the lock gets notified. This person can then doublecheck and open the lock, letting the fish go with the flow to their mating grounds.</p><h3><strong>Ok, you have my attention</strong></h3><p>Like Gijs realized, this seems like a perfect use case for AI, specifically a deep learning algorithm that detects ‘fish-shaped objects’. The website gained <a href="https://www.rtlnieuws.nl/editienl/artikel/5222599/1-april-grappen-nepnieuws-visdeurbel-utrecht-geloofwaardigheid">quite a bit</a> of <a href="https://www.ad.nl/utrecht/utrecht-krijgt-de-eerste-visdeurbel-ter-wereld-en-dit-is-geen-1-aprilgrap-bij-de-sluis-ontstaat-een-vissenfile~adfd2019/">Dutch media attention</a> after the launch <a href="https://www.iamexpat.nl/expat-info/dutch-expat-news/video-worlds-first-fish-doorbell-installed-utrecht">last week</a>, so they have plenty of human intelligence for this object detection task. But artificial intelligence doesn’t get fed up with fads and nowadays is quite capable of object detection. So let’s see how we can automate fish detection!</p><h3><strong>Let’s not reinvent the wheel</strong></h3><p>AI object detection has been around for a while, and has been used to research a plethora of different use cases. The best part? Since the problem had become object detection, I figured: skip the training of a custom model and go straight to implementing a pre-trained model. (So no more Teachable Machine required.) The go-to method for object detection is <a href="https://pjreddie.com/darknet/yolo/">still YOLO</a>. It’s pre-trained on many classes (e.g. person, car, etc.).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*czMsCViobmk_HLzt.gif" /><figcaption>YOLOV3 <a href="https://thumbs.gfycat.com/DampPartialAfghanhound-size_restricted.gif">image from gfycat.com</a></figcaption></figure><p>Judging from glances at the livestream, there didn’t seem to be a whole lot happening below the surface. It consisted mostly of still images and sometimes fish. So if any object would be detected, I was pretty sure it’ll be a fish. I wasn’t expecting a whole lot else to be swimming by. So: 1. download YOLO, 2. apply to the watery dataset and 3. Bob’s your uncle.</p><p>Wrong. Should’ve known, since I also do not have any uncles named Bob. From the livestream data that Gijs retrieved, it turned out there was something fishy in the water. Or rather, there were some not-so-fishy objects floating by in the form of leaves, branches and air bubbles.</p><h3>I love papers with code</h3><p>We needed a purpose-trained model that detects fish specifically. Luckily, since YOLO is so widespread and re-trained to use in many different applications, I figured: Somewhere out there, someone at some point in time, had wanted to detect fish with YOLO as well. And indeed there was! I ran into <a href="https://arxiv.org/ftp/arxiv/papers/1811/1811.01494.pdf">this paper</a> on fish detection with YOLO from Xu and Matzner (2018). In the paper, they did the awesome thing and linked <a href="https://github.com/wenweixu/keras-yolo3">their Github code</a>. Their results on their data looked quite promising.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*9iWq-_uJeVCnyLRo" /><figcaption>Sample results from Xu and Matzner, 2018</figcaption></figure><p>This saved hours/days otherwise spent on labeling and retraining a YOLO model on our own collected fish data. The next step was getting their library to work. For this I created a Google Colab notebook, which together with a paper and Github code is the trifecta of reproducible AI research. Google Colab offers a quick, easy and completely free way to try out deep learning models. These would otherwise require days of setting up a GPU python, TensorFlow and PyTorch environment. See below for link to the interactive Colab.</p><h3>The result</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*0AtLxdmG0yyFn2Bf4n5-VQ.gif" /><figcaption>Sample of YOLO V3 object detection on livestream visdeurbel.nl</figcaption></figure><p>In only an afternoon of tweaking, it’s already quite good at detecting fishy business. There’s also room for improvement, especially in low-light conditions. But with a few simple tweaks, it could already be implemented for visdeurbel.nl’s specific use case. If you were to combine this AI with a simple business rule like:</p><p><em>“If there’s more than 3 fish detected for longer than 5 seconds, then notify person in charge of watching the canal lock.”</em></p><p>This simple addition would immediately:</p><ul><li>limit the number of times the AI would cry wolf-fish</li><li>save the lock watcher from being crowd source pranked by a horde of internet trolls (remember Boaty McBoatface?),</li><li>help out even when humans are not watching the livestream.</li></ul><p><a href="https://colab.research.google.com/drive/1BKHDT4rgAmjteMZ3EVxZVm2Dx0w4DvLg?usp=sharing"><strong>The interactive Colab runs on my Github fork and can be tried out here.</strong></a><strong> </strong>Give it a try even if you’re not that technical, just follow the described steps, or ask in the comments.</p><p>P.S. All fish related puns in this blog are intended. Sorry, not sorry.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d29ae4b9159" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial: Streaming Object Detection on a Raspberry Pi 3 with the Intel Movidius Neural Compute…]]></title>
            <link>https://imagine-ai.medium.com/tutorial-streaming-object-detection-on-a-raspberry-pi-3-with-the-intel-movidius-neural-compute-c22a958b5d1e?source=rss-a2db7a079636------2</link>
            <guid isPermaLink="false">https://medium.com/p/c22a958b5d1e</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[intel-movidius]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Daryl Autar]]></dc:creator>
            <pubDate>Sun, 27 Jan 2019 23:08:08 GMT</pubDate>
            <atom:updated>2019-01-27T23:08:08.736Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tutorial: Streaming Object Detection on a Raspberry Pi 3 with the Intel Movidius Neural Compute Stick</h3><p>Total build time: around 5 hours, most of it is waiting for the Raspberry Pi (RPi) to install packages.</p><p><em>Note: Intel/Movidius have released the Intel Movidius Neural Compute Stick 2 in the meantime, so note the difference.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FMdajhqN7Yeo%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMdajhqN7Yeo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FMdajhqN7Yeo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6fe5ebe2ea95f6f9a4d592b0be53585/href">https://medium.com/media/b6fe5ebe2ea95f6f9a4d592b0be53585/href</a></iframe><p><em>If you don’t care about converting your own models and just want to run a pre-trained streaming object detector on an RPi, skip right to </em><strong><em>step 2 and 3</em></strong><em>. I won’t judge.</em></p><p>When a company comes along and tells you you no longer need to carry a Geforce GTX-1080Ti GPU PC with you to demo model inference for streaming object detection, you bite! Let’s give this Edge Computing thing a shot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*TBPS3EZQMbtArJSITz4euQ.png" /><figcaption>Good job buddy, hiding the pain of carrying it demo to demo</figcaption></figure><p>Some time ago (these writeups sure take a while) my colleagues at my employer and my client and myself have played around with the <a href="https://developer.movidius.com/">Intel Movidius Neural Compute Stick (NCS)</a>. When I say played around with, I mean mostly Googling and crying in a corner (ahh, the data science life). The main reason being t̵h̵e̵ ̵e̵m̵p̵t̵i̵n̵e̵s̵s̵ ̵i̵n̵ ̵m̵y̵ ̵s̵o̵u̵l̵ that the information and documentation were…not in any particularly concentrated place. There was not one single source I could follow to get it to work start to finish for my not-so-specific case (Macbook + RPi + NCS). When even the <a href="https://www.youtube.com/watch?v=KuM67WfTXBQ">AI Vlogmeister himself</a> can’t provide answers, you know it’s serious. So I figured: might as well aggregate everything so anyone can follow it and hopefully save some headaches. Even if you don’t know the first thing about neural networks and deep learning but are semi-handy with computers, you can get it to work!</p><p><strong><em>Disclaimer though</em></strong><em>: these steps worked for me and my colleagues after lots of trial and error…but if they don’t work for you, well at least I got you up to speed.</em></p><p>As for my specific use case: lots of data scientists, AI researchers and machine learning engineers (or whatever term currently ranks higher on Gartner’s Hype Cycle) carry around Macbooks… So imagine my disappointment when I found out that the NCS development kit (NCSDK) given by Intel only works on Ubuntu or Raspbian Stretch. Of course, you can launch a cloud instance, or dual boot, or switch to a full Ubuntu laptop. But before you do something so drastic, why not work with what you have and just launch a Virtual Machine as Apple+Virtualbox intended?</p><h3>So here are the three main steps:</h3><ol><li>Install the full NCSDK on an Ubuntu VM, running on a Mac host. (needed to create model graphs, why no one hosts the most-used NCS graphs remains a mystery)</li><li>Install the API-mode of NCSDK on a RPi. (meaning it only does existing model inference, no training of new models)</li><li>Configure streaming object detection on the RPi.</li></ol><p>For this we’ll need:</p><ul><li>a Mac running High Sierra OSX (make sure it has a USB3 port or if you’re stuck with USB-C ports, like me: use an <a href="https://www.coolblue.nl/product/740095/startech-usb-3-0-reis-docking-station-laptops-hdmi-vga.html?tid=pla-340204366928&amp;ref=378110&amp;gclid=CjwKCAjw4avaBRBPEiwA_ZetYqvlHeC1-OoxjUQMb8krRveROL13HgOO_pKbMhrahOarCYQI4DGiAhoCnUMQAvD_BwE">adapter cable with USB3 port</a>). I have not tried NCSDK with Mojave yet.</li><li>a Raspberry Pi Model 3 B (<a href="https://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/">there are 2 versions</a>, for our demo the a22082 seems to run more stably)</li><li>(optionally: a fancy case, fan and bluetooth keyboard+mouse for the RPi)</li><li>a micro SD card with at least 32 GB (to install Stretch on the RPi)</li><li>a good old USB webcam</li><li>and the <a href="https://developer.movidius.com/buy">Neural Compute Stick</a> itself of course.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*uWT_NQTzs7iqjCLvnDdxEQ.png" /></figure><h3>Step 1: Install NCSDK on Ubuntu VM on a Mac host</h3><p><strong>Important: </strong>choose one and the same version of the NCSDK. At the time of writing there are 2 versions. By default ncsdk from github gives the 1.x version, choosing ncsdk2 requires manual input. For this tutorial we’ll choose v1. Why, you ask? Because it’s the first one we got to work.</p><p><strong>Also important:</strong> running the NCSDK on a RPi means TensorFlow is not supported, only caffe models (PyTorch anyone?). If you want to test your luck with tensorflow, go for the 2.X install that builds a nightly tensorflow 1.16 for your RPi.</p><p><strong>We’ll start by installing an Ubuntu VM on a Virtualbox on you Mac. </strong>This allows you to essentially run a different OS inside your current one. For this there are a couple of steps:</p><ol><li><a href="https://download.virtualbox.org/virtualbox/6.0.2/VirtualBox-6.0.2-128162-OSX.dmg">Download and Install the latest virtual box.</a></li><li><a href="https://download.virtualbox.org/virtualbox/6.0.2/Oracle_VM_VirtualBox_Extension_Pack-6.0.2.vbox-extpack">Download and Install the latest virtual box extension pack.</a></li><li><a href="http://releases.ubuntu.com/16.04/ubuntu-16.04.5-desktop-amd64.iso.torrent?_ga=2.37409705.805578182.1548620265-1667505529.1548620265">Download the Ubuntu 16.04 LTS ISO file and install Ubuntu on Virtualbox.</a> 18.04 broke it for us, so try that one at your own risk. Open Virtualbox and follow the GUI to add a new machine.</li><li>Upgrade the Ubuntu VM via terminal using ‘sudo apt-get upgrade’.</li><li>Run these commands in a terminal window on your Ubuntu VM.<br>mkdir -p ~/workspace<br>cd ~/workspace<br>git clone <a href="https://github.com/movidius/ncsdk.git">https://github.com/movidius/ncsdk.git</a><br>cd ~/workspace/ncsdk<br>make install</li><li>Setup USB Settings for the NCS stick to be attached to the VM<br> USB2 Device Filter Details ==&gt; Vendor ID == “03e7” <br> USB3 Device Filter Details ==&gt; Vendor ID == “040e”</li><li>Attach the Neural Compute Stick to your computer and the Ubuntu VM should see it. Verify using ‘lsusb’ in terminal to see if you see a usb device with Vendor ID == 03e7.</li><li>The USB controller setting should be set to USB3.0(XHCI). Make sure you turn off the VM before editing the USB devices and set it to the 3.0 controller.</li><li>If you followed step 8, when plugging in the NCS and clicking on ‘Devices’ ==&gt; ‘USB’ in the Virtualbox menu when you have the Ubuntu VM running, it will find a mysterious loopback device in your USB devices list. Click and add every single device that magically appeared to make them available in the Ubuntu VM (for me there were 3 of them).</li><li>Reboot the VM after adding these 3 usb devices. Important one to overlook.</li><li>Now try ‘make examples’ in ncsdk workspace folder. Ironically, this is just step 3 from the official Movidius start tutorial. It gives me flashbacks to everytime in university when math+stats books the authors said “It’s easy to see that…” and skipped the derivation.</li><li>If it runs: success! You are now able to convert all the object detection models you’ve trained in Caffe to the native NCS format. If it doesn’t run…well in the meantime they’ve released NCS 2 sticks, which might work easier.</li></ol><h3>Step 2 and 3: running real-time object detection models on an RPi</h3><p>Lucky you! Since I first set out to writing this, my <a href="https://www.devolksbank.nl/artikel/object-detection-on-a-stiiiiiiiiiick.html">colleague at my current client who has way better developer skills</a> bundled all these steps I was typing out for you into a smoothly working github project. Check it out and we’ll look forward to your pull requests!</p><p><a href="https://github.com/devolksbank/Raspberry-Pi-Movidius-Person-Detector">devolksbank/Raspberry-Pi-Movidius-Person-Detector</a></p><h3>The result</h3><p>It’s pretty cool. Not the most stable thing, but it runs at around 15 fps for a limited number of object classes. Which is less than the 25 fps from a 1080Ti desktop beast running something like Darknet’s YoloV3. But it’s quite respectable given that it opens up a plethora of new business cases with it’s small and lightweight setup. (Face detecting drones, anyone?) In less than a year, our setup at the Dutch Big Data Expo went from the full desktop GPU you saw at the beginning, to this byte-sized (pun intended) configuration:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F68sv6Qf12-s%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D68sv6Qf12-s&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F68sv6Qf12-s%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/821b8413eb5efe269606a1f60d83fbd3/href">https://medium.com/media/821b8413eb5efe269606a1f60d83fbd3/href</a></iframe><p><strong>List of used sources (every single one of these has been essential in getting it to work, hence my urge to aggregate the information):</strong></p><ul><li><a href="https://movidius.github.io/ncsdk/install.html">Basic Installation and Configuration</a></li><li><a href="https://github.com/acharroux/Movidius-On-MacOS">acharroux/Movidius-On-MacOS</a></li><li><a href="https://ncsforum.movidius.com/discussion/139/error-7-toolkit-error-usb-failure-code-error-opening-device">[Error 7] Toolkit Error: USB Failure. Code: Error opening device</a></li><li><a href="https://ncsforum.movidius.com/discussion/comment/855#Comment_855">Installation under VirtualBox?</a></li><li><a href="https://ncsforum.movidius.com/discussion/206/usb-disconnect-while-building-the-examples">USB disconnect while building the examples</a></li></ul><p>Pretty sure this is an important face since he shows up three times.</p><ul><li><a href="https://ncsforum.movidius.com/discussion/140/mac-os-x">MAC OS X</a></li><li><a href="https://movidius.github.io/ncsdk/tools/compile.html">mvNCCompile</a></li><li><a href="https://movidius.github.io/blog/ncs-image-classifier/">Build an Image Classifier in 5 steps</a></li><li><a href="https://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/">Checking Your Raspberry Pi Revision Number &amp; Board Version - Raspberry Pi Spy</a></li><li><a href="https://www.devolksbank.nl/artikel/object-detection-on-a-stiiiiiiiiiick.html">Object detection &#39;&#39;on a stiiiiiiiiiick&#39;&#39;</a></li></ul><p>My first ever Medium blog/tutorial, let me know whether it helped you in any way or if you found shortcuts in the steps we took :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c22a958b5d1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>