<?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 Snehal Akhouri on Medium]]></title>
        <description><![CDATA[Stories by Snehal Akhouri on Medium]]></description>
        <link>https://medium.com/@snehalakhouri?source=rss-515e01f50611------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*itSwDjpu3RrIEEKG1j_4iQ.jpeg</url>
            <title>Stories by Snehal Akhouri on Medium</title>
            <link>https://medium.com/@snehalakhouri?source=rss-515e01f50611------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:44:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@snehalakhouri/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[Machine Vision For Test Automation — Part 2]]></title>
            <link>https://blog.hotstar.com/machine-vision-for-test-automation-part-2-70769e8b768a?source=rss-515e01f50611------2</link>
            <guid isPermaLink="false">https://medium.com/p/70769e8b768a</guid>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[machine-vision]]></category>
            <category><![CDATA[automation-testing]]></category>
            <dc:creator><![CDATA[Snehal Akhouri]]></dc:creator>
            <pubDate>Wed, 23 Dec 2020 17:30:53 GMT</pubDate>
            <atom:updated>2020-12-23T17:30:53.411Z</atom:updated>
            <content:encoded><![CDATA[<h3>Machine Vision For Test Automation — Part Two</h3><p>If you missed it, read the <a href="https://blog.hotstar.com/machine-vision-in-test-automation-5ab8682254ba">first part here</a>. Now, onwards.</p><h3>Part 2: AI for keeps — Artwork Validation</h3><p>Hotstar has always put a huge premium on building for <em>Bharat. </em>Building for <em>Bharat </em>starts with making content accessible in the language of choice for our customers. The platform has always been able to auto-start content in the language best suited for our customer, basis various factors, if the content supports multiple language dubs.</p><p>As part of our launch strategy for Disney+Hotstar, we brought the beloved Disney catalog in the language that resonates with our customers. Content is more than just the video, it is the sum of the video, subtitles, meta, dubbed languages and the artwork (posters). All of these should come together in uniformity to deliver a seamless experience to the user. Language hence became a primary engagement driver for Disney content for <em>Bharat.</em></p><h3>Requirement</h3><ul><li>Validate that the dubbed language, artwork, video and meta of a given content is uniform per language. (in simple terms: A Tamil consumer should see Tamil in the poster so as to influence the customer to click and watch it)</li><li>Avoid user pain<br>- I see the poster in my language, however the language dub is missing<br>- Why am I shown a language poster which I don’t understand?<br>- Does this content have my language ?<br>- Why am I offered languages which I don’t speak ?</li></ul><p>We had to verify this for the massive Disney content library for India which had thousands of titles. Sampling was the only way a set of humans would have been able to verify a small percentage of all contents. This would lead to user pain, where a Telugu user would possibly see a poster callout Telugu in it, but disappointment follows when the content doesn’t have Telugu dubbed audio.</p><p>For better understanding, have a look at the poster of Avengers: Endgame below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VxiTmTn3CZywBmk0" /></figure><p>Observe the poster , and the “Available in ” section below the image.</p><h3>Challenges</h3><ul><li>It is impossible for a Design Operations team to “ensure” that all contents have the required artwork attached, when we are talking about thousands of contents.</li><li>It is further impossible to rule out that a misconfiguration hasn’t happened before the launch where the wrong content and artwork are mapped.</li></ul><h3>What we discovered</h3><p>The artwork is basically an image with the text embedded in it. In order to get close to validating whether the correct language text is showing in the artwork, we first had to extract it, then compare it with our base set of training data and get a response from our Image Validator service on the confidence level for a match.</p><p>We used the Image Validator service’s text extraction and image matching APIs. But it was not a straightforward solve due to the following reasons:</p><ol><li>Some posters had languages call out in middle, some on left and some on right of the poster</li><li>Some language callouts were camouflaged by the background of the text (eg. bright or dark backgrounds, jazzy or colourful pictures)</li><li>Almost all language callout texts were in different colours (to help them stand out from their background colour)</li><li>Of course the language callout itself was in a Indian language like Tamil, Telugu etc. English &gt; English text pattern matching is easier considerably.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HLmwCJfW-GqyNc2X" /></figure><p>Even our best optimisations resulted in a success rate of &lt; 50% overall. Which meant that we had no guarantee that we were throwing false positives, much less fall negatives in our test results. Clearly, we weren’t succeeding.</p><p>We then decided to change our strategy and combine two AI features, text extraction &amp; matching with pattern recognition and build a hybrid custom model of our own. To avoid over engineering it, we created two parallel threads which would converge at the point of verification — the combination of confidence level on each thread would be the overall confidence percentage.</p><p>This was great, but we still haven’t defeated our primary enemy — noise.</p><p><strong>Reduce the noise please!</strong></p><p><strong>Step 1</strong>: We used an image processing feature to remove all the unwanted noise from the source image. We removed the edges, cropped pictures, resized them to be the same size as the baseline image to ease comparison.</p><p><strong>Step 2</strong>: Removed colour — Made the image colourless (Black and White). Actually this was quite useful, once images go black/white they are sharper and text stands out clearer to work with. The contrast between black and white ensures the bots are not confused by soft color transitions and overlaps into the text which we were interested in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8mh1MlzzmRfb5QH7" /></figure><p>Image generated after step 1 &amp; 2</p><p><strong>Step 3</strong>: Gathered different patterns and fed them as a training image. We ran tests and found out different patterns which were not recognised directly by our text extraction logic. Eg :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/136/0*A_ewlGXpxy9itxqN" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/114/0*rDhwThHEi1H_PUWe" /></figure><p>A bot would be able to make a match only 50% of time to the above image. The weight of the font is clearly different enough for the bot to be confused on its confidence.</p><p>We hence bundled the patterns and fed them as a training image for pattern recognition to work.</p><p>Voila !</p><p>We were able to improve accuracy and bumped the success rate to ~99–100%. We tested and retested the test results dozens of times, including human verification on results to ensure there are no false positives or false negatives. To our great excitement, we had cracked it and for the first time at Hotstar, we had a working framework to trawl through thousands of titles and ensure the Artwork is what it is supposed to be.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Iz17moIKwYoC16sw" /><figcaption>Flow Diagram of Artwork Validation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TBbQjnyOTHln_UsS" /><figcaption>Sample Failure Report</figcaption></figure><p>This whole exercise gave us greater confidence to solve bigger problems in our content validation capabilities. In further blogs from my colleagues they will articulate how Poster validation has become a core part of our automated Content Factory validation, a journey which started from a completely different objective of LiveAds validation and now has taken a life of its own !</p><p>If you want to solve problems like these, then do check out open roles in our automation team at <a href="https://tech.hotstar.com/">https://tech.hotstar.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70769e8b768a" width="1" height="1" alt=""><hr><p><a href="https://blog.hotstar.com/machine-vision-for-test-automation-part-2-70769e8b768a">Machine Vision For Test Automation — Part 2</a> was originally published in <a href="https://blog.hotstar.com/">JioHotstar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Vision in Test Automation]]></title>
            <link>https://blog.hotstar.com/machine-vision-in-test-automation-5ab8682254ba?source=rss-515e01f50611------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ab8682254ba</guid>
            <category><![CDATA[machine-vision]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[tesseract]]></category>
            <category><![CDATA[opencv]]></category>
            <dc:creator><![CDATA[Snehal Akhouri]]></dc:creator>
            <pubDate>Thu, 08 Oct 2020 06:21:13 GMT</pubDate>
            <atom:updated>2020-10-08T06:21:13.397Z</atom:updated>
            <content:encoded><![CDATA[<p>Every once in a while we come across interesting problems we must solve, but are no longer tenable with the usual toolset at our disposal. At our scale, at Disney+Hotstar Quality Engineering, that happens fairly frequently and the way we look to solve these problems is to look at other domains and try to learn and implement solutions that are unique to us.</p><p>In a two part blog, we will talk about how machine vision, leveraging artificial intelligence, can help become the human eye in checks that are too voluminous, contextual and energy draining for a human to participate in.</p><h3>Let machines do the work!!</h3><p>Our first problem statement was around our ads stack. We were faced with two interesting challenges that we needed to solve at speed and scale:</p><ul><li>Guarantee correct ad content is shown to the user in a live match.</li><li>Guarantee that the ad formats appear visually exactly as business (and clients) intend it to.</li></ul><h3>Live Ads Detection</h3><p>Serving the right advertisement to the right customer is paramount. Any platform which cannot do this reliably all the time is setting up its clients for failure in reaching the intended target of their campaigns and disappointing its users by serving irrelevant ads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*LbhIvpwjTKWj7GkG" /></figure><p>Target users are bucketed in various buckets based on device type, geography, gender, age, tastes, and so on. The industry term for such buckets is “cohorts”, put simply, a cohort is a combination of many attributes a target user may fall into. As a platform you want the capability to target different customers with different advertisements, so that you and me sitting in the same bus to home while watching the Indian Premier League (IPL) on our phones can get two different advertisements as we both are practically users with different attributes.</p><p>For a leading prime time content like IPL which draws millions of users in a typical match, there can potentially be thousands of cohorts and again thousands of users getting bucketed into each of them.</p><p>How could we test that our cohort logic was working fine ? Further, whether the intended advertisement was showing in the target user device in the correct format and content (photo, video, survey, etc.) ?</p><p>To further complicate things, ads in IPL are slotted between two overs in the live stream, usually a slot can run for 30 seconds, but could be “crashed” if the action resumes, with multiple ads squeezed into it. Each ad in a typical slot would be different from others — one ad might have a CTA button or an external link or some actions for the users to perform while the other one may be just a video roll and a further third ad could be a combination of some of these.</p><p>Our advertisement tech platform is completely automated, however the operational aspects of advertisement cannot be automated since brands and campaign managers need the freedom to keep changing their creatives and the ad-elements to be able to impress and influence their intended target users, sometimes in real time.</p><p>We found this is the part which opened a gate to broken experiences for the end customer and missed opportunities for business due to manual operational errors to update a creative to the correct ad type or creative or ad elements. How do we detect an operational mistake like a wrong ad creative shown to the user or even if the right creative is shown it is not missing critical ad elements (Click through button, links, or actions) — and that too while the Live match is underway!</p><p><strong>How complex is it ?</strong></p><p>To set context, if you have one person monitoring ad delivery on one device for a particular cohort throughout a live IPL match duration (5 hours approximately). We would need upwards of 9000 people monitoring live ads for the duration of the game, given the multiple cohorts that we can target.</p><p>Obviously this is not a scalable approach, so we decided to take a smarter route and develop a tool which we call “LIVE Ads Detector”.</p><p>We also started to build a common test service alongside this tool with the belief that if we can solve this problem, it will unlock many other use cases that surface in the coming times that the service can help with.</p><h3>Requirements</h3><ul><li>Identify and detect each ad type on a live stream</li><li>Verify ads are rendered as expected on actual device (CTA , WatchList and Link Type Ad Formats on live content)</li><li>Real-time reporting of verification</li></ul><h3>Challenges</h3><p>The two major challenges we faced were :-</p><p><strong>Detecting elements with Appium</strong></p><ul><li>Appium needs element ids, but it’s 2020 and who defines element ids anymore.</li><li>Appium requires the main thread to be free to issue GET commands. Our Social feed, rolling ads makes it impossible to free the main thread.</li></ul><p><strong>Network Interception Layer</strong></p><ul><li>We needed to find a middle layer which can tell our LIVE Ads Detector what ad type we should expect in the next second on the player. This layer needs to alert real time, zero tolerance for latency.</li></ul><h3>Solution</h3><p>We broke the solution into two parts:</p><ul><li>MITM : To intercept VAST calls. Reading the VAST call allows us to determine the type and behaviour of upcoming ad</li><li>Image Validator service (Template Matching and Text extraction service).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9VS_axik51VuNFfg" /><figcaption>Working Model of live ads detector</figcaption></figure><p>Figure: Image validator service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/0*T0LEfwS9lrIz1WW2" /></figure><p>In the example above, how could we ensure the banner ad shown is for exactly the same match that is shown in the masthead — and whether the two images are even for the match IND Vs SA.</p><p>What happens when the app is not able to render the image due to a bug, or app renders an incorrect image? The test will still pass , but in reality if a human sees the masthead which has a wrong image or corrupted image the test will fail.</p><p>Training and predicting patterns, faces and objects in a source image is the answer. Our Image Validator service is built on an implementation of <a href="https://opencv.org/">OpenCV</a>, <a href="https://github.com/tesseract-ocr/tesseract">Tesseract</a> and image processing/normalising. We started applying the service in our regular automation — expanding our training and test data sets to gain confidence of its accuracy.</p><h3>Why Machine Vision?</h3><ul><li>AI doesn’t care about elements. It doesn’t care whether you are using an Android driver or iOS driver in your automation.</li><li>Training data set creation is simpler — collect data, identify outliers in your data and focus on main features and accuracy in detecting those</li><li>Lend eyes to AI — allow your test automation to stream real time data to the image validator service for comparisons</li></ul><h3>Image Validator Features</h3><p>Let’s have a look at features that we support in the image validator currently and their functional overview</p><h3>Object Detection / Template Matching</h3><p>We use an OpenCV template for matching patterns in a source image to a trained image.</p><p>Here are a few examples:</p><p>Typical automation would identify the image below of a “yellow bar” component in the UI as just another element and assert that it is displayed.</p><p>However, the nuance here is that the yellow bar is a progress bar which progresses proportionate to the ad-video playing. Its appearance suggests an ad is playing, its disappearance suggests ad has ended. So, would normal automation be able to assert on ad progress, start/end of an ad visually ? Further the ad video could get stuck, progress bar could malfunction or not show at all and so on. We needed to marry visual verification to mid-layer VAST intercepts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*CXiE5j6Bvo6iSlVd" /><figcaption>Asset Image (Yellow Bar)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/0*mHl2JMQrcGkt56S7" /><figcaption>Screenshot while ad is playing during a live event</figcaption></figure><p>Source image for us is a screenshot taken from an actual device where the user is viewing a match and encounters an ad.</p><p>Automation calls an API in Image Validator service for pattern matching , which takes the screenshot as input and runs against all the patterns we have had stored in assets folder (S3) and returns in API response all the matches with confidence ratios and location of its bounding box (x,y coordinates). With that settled, the automated test can safely assert on the final verdict based on its threshold confidence level expectation.</p><h3>Text Extraction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/0*Tj-rxDOoS8i7tAxO" /><figcaption>Video Ad with CTA text “DOWNLOAD”</figcaption></figure><p>This is different from pattern matching, here we need to ‘extract’ the text from the source image. We use OpenCV and Tesseract to achieve that.</p><p>Let’s take an example</p><p>We have a Ad source image like above displayed which has a embedded link that has a text “DOWNLOAD” &amp; &lt;app name&gt;, let’s assume that our scenario is something like this :-</p><p>When DOWNLOAD text is displayed</p><p>And if User clicks on DOWNLOAD</p><p>Then User lands on the “Google Play Store” page of the client &lt;app name&gt;.</p><p>[remember a simple operational blunder would mean an invalid text &amp; link has been configured]</p><p>Image Validator service has an API for text matching where it searches for an expected text in a source image file, in this case “DOWNLOAD“. On calling the API, the algorithm eliminates all the noise from the image and extracts all the possible words, then it traverses through and finds the exact or closest match and also extracts the location of the bounding box. The API then returns location, UI coordinates, if text is found.</p><p>This way our automated tests can not only verify that some text shows up, but we can also be 100% sure that not only it is the exact expected text, but that the link also takes the user to the correct location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Hyvj6_YnpAyRrZA8" /></figure><h3>It’s ALIVE!</h3><p>We followed the train and predict model, combined AI features and built a hybrid to solve a complex problem of Live Ads Validations at hotstar scale. And adding live reporting was cherry on cake !!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BSzg6rzn_6ypFspo" /><figcaption>Sample Live Ads Report</figcaption></figure><p>Yes.. we saved man hours and instead of constantly watching the stream for issues, we now have a machine doing the work and we have setup alerts and all we need to do is monitor them and take actions accordingly.</p><p>Stay tuned for Part 2 — where we will delve into more goodness!</p><p>If you want to solve problems like these and work smart, look up our open job positions on <a href="https://tech.hotstar.com/">tech.hotstar.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ab8682254ba" width="1" height="1" alt=""><hr><p><a href="https://blog.hotstar.com/machine-vision-in-test-automation-5ab8682254ba">Machine Vision in Test Automation</a> was originally published in <a href="https://blog.hotstar.com/">JioHotstar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>