<?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 Shruti Sharma on Medium]]></title>
        <description><![CDATA[Stories by Shruti Sharma on Medium]]></description>
        <link>https://medium.com/@curioushruti?source=rss-376865ac8e98------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DMkFFpnxpP9rZJfNa8Vexg.jpeg</url>
            <title>Stories by Shruti Sharma on Medium</title>
            <link>https://medium.com/@curioushruti?source=rss-376865ac8e98------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 04:45:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@curioushruti/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[Using On-Device Machine Learning to Suggest Presets for Images in VSCO]]></title>
            <link>https://medium.com/vscostories/using-on-device-machine-learning-to-suggest-presets-for-images-in-vsco-76c1c7132478?source=rss-376865ac8e98------2</link>
            <guid isPermaLink="false">https://medium.com/p/76c1c7132478</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[subscription]]></category>
            <category><![CDATA[image-editing]]></category>
            <category><![CDATA[recommendations]]></category>
            <dc:creator><![CDATA[Shruti Sharma]]></dc:creator>
            <pubDate>Sat, 26 Sep 2020 00:14:33 GMT</pubDate>
            <atom:updated>2020-10-19T22:34:41.192Z</atom:updated>
            <content:encoded><![CDATA[<p>At VSCO, we’re using machine learning (ML) in many different ways. One of the most exciting is our latest feature taking advantage of on-device ML: for this photo. It’s a great solution to a complex problem, and it also combines exciting areas of technology for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*MBbPhLJS4iTNWbYxRR-6qw.jpeg" /><figcaption>“For This Photo” feature</figcaption></figure><h3>The Challenge</h3><p>VSCO has a catalog of over 200 presets, which are pre-configured editing adjustments to help our users transform their images. These include emulations of old film camera stock such as <a href="https://eng.vsco.co/reviving-kodachrome/">Kodak Kodachrome 25</a>, Fujifilm Velvia 50, Agfa Ultra 50, and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QW1bAOaGL_TtqI0_tJ7kvA.jpeg" /><figcaption>Image by Sarah Hollander</figcaption></figure><p>With so many presets to choose from, our research suggested members were overwhelmed and stuck to using the few favorites they knew and liked, instead of trying new presets.</p><h3>The Solution</h3><p>Our challenge was to overcome decision fatigue by providing trusted guidance and encouraging discovery, while still leaving space for our users to be creative in how they edit their images. We decided to solve this problem by suggesting presets for images. We developed the “For This Photo” feature, which uses on-device ML to identify what kind of photoa user is editing and then suggest relevant presets from a curated list. The feature has been so loved by our users that “For This Photo” is now the second most used preset category second only to showing all available presets.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfHbjfeitIvE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfHbjfeitIvE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FfHbjfeitIvE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fef04331f8feb74ff59e21fe6fa6d1c/href">https://medium.com/media/8fef04331f8feb74ff59e21fe6fa6d1c/href</a></iframe><p>We decided to use <a href="https://cs231n.github.io/convolutional-networks/">deep convolutional neural network</a> (CNN) models because these models can understand a lot of the nuances in the images, making categorization easier and faster than traditional computer vision algorithms. Our Imaging team thoughtfully curated presets that complement different types of images, allowing us to deliver a personalized recommendation for each photo.</p><p>To understand the flow of how the “For This Photo” feature works when a user starts editing an image, we will walk through the steps that take place:</p><ol><li>When a user loads the image in the Edit View of our photo editor, inference (prediction) via the model is instantly kicked off.</li><li>After inference, the model returns a category for the image, such as “portrait” or “urban”.</li><li>The ID of the image category is then matched with the corresponding ID in the cached catalog which contains a predefined list of presets for each category.</li><li>Six presets are chosen from the list of presets that are retrieved, some of which are available to everyone and some that are available only with a VSCO Membership. These presets end up in the “For this Photo” tray in our photo editor.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QNnflGdOwQ-SBWHbetEj9w.jpeg" /><figcaption>Diagram by Zach Hodges</figcaption></figure><p>Showing free and paid presets is important to us in order to provide value to everyone who uses VSCO, while also demonstrating the value of membership to them. To this end, the presets that are part of VSCO membership can still be previewed by non-members. For members, it has the benefit of educating them on the type of images their member-only presets can be used on.</p><h4>On-device ML ensures accessibility, speed, and privacy</h4><p>From the get-go, we knew server-based machine learning was not an option for this feature. There were three main reasons we wanted this feature to use on-device ML: offline editing, speed, and privacy.</p><p>First, we did not want to limit our members’ creativity by offering this feature only when they were online. Inspiration can strike anywhere — someone could be taking and editing photos with limited network connectivity, in the middle of a desert, or high up on a mountain.</p><p>Second, we wanted to ensure editing would be fast. If we offered “For This Photo” with the ML model in the cloud, we’d have to upload users’ images to categorize them (which takes time, bandwidth, and data), and users would have to download the presets, making the process slow on a good connection and impossible on a poor one. Doing the ML on-device means that everything happens locally, quickly, with no connection required. This is crucial for helping users capture the moment and stay in the creative flow.</p><p>Third, the editing process is private. A server-side solution would require us to upload user photos while the users were still editing them before they published them. We wanted to be cognizant of our users’ privacy in their creative process.</p><h3>Overview of VSCO’s Machine Learning Stack</h3><p>The three main components of our ML tech stack are: <a href="https://www.tensorflow.org/">TensorFlow</a>, <a href="https://spark.apache.org/">Apache Spark</a>, and <a href="https://www.elastic.co/products/elasticsearch">Elasticsearch</a>. We use TensorFlow for deep learning on images, Apache Spark for shallow learning on behavioral data, and Elasticsearch for search and relevance.</p><p>We have a real-time cloud-based inference pipeline using TensorFlow Serving that runs every image uploaded to VSCO through various convolutional neural networks in real-time. The inference results of these models are then used for product features like Related Images, Search, Just For You, and other sections in Discover, etc. For on-device machine learning, we use <a href="https://developers.google.com/ml-kit/">ML Kit </a>+ <a href="https://www.tensorflow.org/lite">TensorFlow Lite</a> on Android and <a href="https://developer.apple.com/machine-learning/core-ml/">Core ML</a> on iOS for on-device inference. We’ll get into the details of this part of our stack in the next section.</p><p>We also have an Apache Spark-based recommendation engine that allows us to train models on large datasets from different sources in our data store: image metadata, behavioral events, and relational data. We then use the results of these models to serve personalized recommendations in various forms, like our User Suggestions feature.</p><p>To power our ML pipeline, we use <a href="https://kafka.apache.org/">Apache Kafka</a> for log-based distributed streaming of data that serves as input for all our ML models, and <a href="https://kubernetes.io/">Kubernetes</a> for deploying all our micro-services. The languages we use include Python, C++, Go, Scala, and for on-device integrations, we use Java/Kotlin and Swift/Obj-C.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dTIHI0J9kFDAY3eaONW3FQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjxXb5bKYYv1t4W1-WXsrg.jpeg" /></figure><h3>“For This Photo” — Technical Implementation</h3><h4>Step One: Categorizing Images</h4><p>n order to build a model that serves the “For This Photo” feature, we wanted to be able to first assign a category to the image and then suggest presets that were designed to work well for that category.</p><p>We started with image data tagged by our in-house human curators. These curators are photography experts who have a front-row seat to our user behavior, so they know better than anyone what type of content is being shared and what trends are developing. They helped our engineering team come up with image categories for our model, which include: art, portrait, vibrant, coastal, nature, architecture, light and shadow, monochrome, and many more. As the saying goes, 90% of machine learning is about cleaning up your data. These steps helped take care of making sure the data our model was based on was reliable.</p><p>Using this categorized dataset, we trained a CNN model in TensorFlow based on <a href="https://arxiv.org/abs/1602.07360">SqueezeNet</a> architecture. We chose this architecture because of its smaller size without much loss in accuracy compared to other architectures.</p><p><strong>ML Kit on Android</strong></p><p>Knowing that we wanted to do on-device machine learning with our custom model, TensorFlow Lite was an obvious choice due to the ease of taking a model trained on the server and converting it to a model compatible for a phone (.tflite format) by using the <a href="https://www.tensorflow.org/api_docs/python/tf/lite/TFLiteConverter">TFLiteConverter</a>.</p><p>Also, we had already experienced the success of TensorFlow and TensorFlow Serving in production systems for our server-side ML. TensorFlow’s libraries are designed with running ML in production as a primary focus so we felt TensorFlow Lite will be no different.</p><p>We used <a href="https://developers.google.com/ml-kit/">ML Kit</a> to run inference on a TensorFlow Lite model. ML Kit provided higher-level APIs for us to take care of initializing and loading a model as well as running inference on images without having to deal with the lower level TensorFlow Lite C++ libraries directly. This made the development process much faster and left us with more time to hone our model instead, causing us to take the feature from prototype to production-ready fairly quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*4oyMtdaK4MWX0k4WJPVQ5w.jpeg" /><figcaption>Categorizing an image — Android</figcaption></figure><p>We converted this trained model from TensorFlow’s Saved Model format to TensorFlow Lite (.tflite) format using the<a href="https://www.tensorflow.org/api_docs/python/tf/lite/TFLiteConverter"> TFLiteConverter</a> for use on Android. Some of the causes of our initial bugs in this stage were due to the mismatch in the version of TFLiteConverter we used compared to the version of TensorFlow Lite library that ML Kit had a reference to via Maven. The ML Kit team was very helpful in helping us fix these issues as they came up.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d8e4cc4d45fc39836934bb634b0f91c/href">https://medium.com/media/1d8e4cc4d45fc39836934bb634b0f91c/href</a></iframe><p>Once we had a model that could categorize images, we bundled it into our app and ran inference on images with it pretty easily using ML Kit. Since we were using our own custom trained model, we used<a href="https://firebase.google.com/docs/ml-kit/use-custom-models"> Custom Model API from ML Kit</a>. For better accuracy, we decided to forgo the quantization step in model conversion and use a floating-point model. There were some challenges here because ML Kit assumes a quantized model by default. With a little effort, we changed some of the steps in model initialization to support a floating-point model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/685d8dc355499d2a86f93c2f988af3a9/href">https://medium.com/media/685d8dc355499d2a86f93c2f988af3a9/href</a></iframe><p><strong>Core ML on iOS</strong></p><p>For iOS, Core ML was the obvious choice for on-device ML. It’s been around for a couple years and is a very mature and easy-to-use library. Core ML provides high-level APIs all the way from converting the model to Core ML format to the actual inference on images on-device. While running inference, Core ML allows the app to get the maximum possible performance using the hardware acceleration provided by Apple’s neural engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*9Ef0v8xq8hlWZoCKOuSR5g.jpeg" /><figcaption>Categorizing an image — iOS</figcaption></figure><p>Apple’s<a href="https://github.com/apple/coremltools"> Core ML Tools</a> made it very easy to convert our server-trained model into Core ML (.mlmodel) format. Since this converter supports Keras and Caffe model types but not TensorFlow’s Saved Model type, we decided to use a Caffe model we had trained in the SqueezeNet format. The best part was that this converter even let us specify the channel-wise bias as well as channel order for the input image that the model needed. This made these pre-processing steps part of the converted model; meaning we didn’t have to pre-process the images in our app before feeding them into the model during inference.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb5ee2bef62ab1e24bacc6610c8986c2/href">https://medium.com/media/eb5ee2bef62ab1e24bacc6610c8986c2/href</a></iframe><p>Once we had a model that could assign categories to images, Core ML made it pretty straightforward to bundle this model into our app and run inference on images with it. Adding the model to our Xcode project was as simple as dragging the model into the project navigator. Core ML automatically generates a Swift class that provides easy access to the ML model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba4e5835566458d10dccbd340929d9b8/href">https://medium.com/media/ba4e5835566458d10dccbd340929d9b8/href</a></iframe><h4>Step Two: Suggesting Presets</h4><p>The next challenge was to suggest presets based on these categories of images. We collaborated with our in-house Imaging team who had created these presets to come up with lists of presets that work well for images in each of these categories. This process included rigorous testing on many images in each category (landscape, water, etc.) where we analyzed how each preset affected various colors. In the end, we had a curated catalog with tastefully chosen presets mapped to each category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*JUgav2x03_Dxgf2A6oqfFA.jpeg" /><figcaption>Suggesting presets for an image</figcaption></figure><p>These curated catalogs are ever-evolving as we add new presets to our membership offering. In order to make it easier for us to update these lists on the fly, without the users having to update their app, we decided to store these catalogs on the server and serve them using an API, a microservice written in Go which the mobile clients check-in with periodically to make sure they have the latest version of the catalogs. The mobile clients cache this catalog and only fetch when there is a new version of the catalog available. However, this approach creates a “cold start” problem for users who do not connect to the internet before trying out this feature for the first time, not giving the app an opportunity to connect to the API and download these catalogs. To solve this, we decided to ship a default version of these catalogs with the app. This allows all users to be able to use this feature regardless of their internet connectivity, ensuring one of the original goals of this feature to begin with.</p><h3>Results and Conclusion</h3><p>With “For This Photo”, we accomplished our goal to make editing with presets easier to navigate. We believe that if our members don’t find value in getting new presets, their creative progress is being hindered. We wanted to do better. We wanted to help more users not just discover new presets, but zero in on the presets that best matched what they were working on.</p><p>At VSCO, we’re looking to ML to provide inspiration and trusted guidance. We want to continue to improve “For This Photo” to provide recommendations based on other image characteristics as well as the user’s community actions (e.g. follows, favorites, and reposts). We also want to provide greater context for those recommendations, and to encourage our community of creators to discover and help fuel the creative spark in each other.</p><p><em>Acknowledgments</em></p><p>Many people from multiple teams contributed to the development of this feature — Yuanzhen Li, Melinda Lu, Katherine Pioro, Eric Cheong, Viet Pham, Maggie Carson Jurow, RJ Simonian, Augustine Ortiz, and many others.</p><p>Thanks to Jenny Zheng, Zach Hodges, Lucas Kacher, and Jessica Jiang for copy editing and reviews.</p><p>If you find this kind of work interesting, <a href="https://vsco.co/about/careers">come join us!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76c1c7132478" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/using-on-device-machine-learning-to-suggest-presets-for-images-in-vsco-76c1c7132478">Using On-Device Machine Learning to Suggest Presets for Images in VSCO</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Degenerate Feedback Loops in Recommender Systems]]></title>
            <link>https://medium.com/@curioushruti/degenerate-feedback-loops-in-recommender-systems-3f47e9f3b9bc?source=rss-376865ac8e98------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f47e9f3b9bc</guid>
            <category><![CDATA[recommender-systems]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Shruti Sharma]]></dc:creator>
            <pubDate>Thu, 01 Aug 2019 18:40:02 GMT</pubDate>
            <atom:updated>2019-08-02T01:56:34.378Z</atom:updated>
            <content:encoded><![CDATA[<p>Research Paper Summary Series — Episode 1</p><p>This is an article summarizing my understanding of <a href="https://arxiv.org/abs/1902.10730">this</a> research paper.</p><h4><strong>Reference</strong></h4><p>Ray Jiang, Silvia Chiappa, Tor Lattimore, Andras Agyorgy, and Pushmeet Kohli. 2019. <em>Degenerate Feedback Loops in Recommender Systems.</em><br>arXiv: <a href="https://arxiv.org/abs/1902.10730v3">arXiv:1902.10730v3</a> [stat.ML]</p><p>Recommender systems are used in consumer software products, most widely seen in websites or mobile apps, to predict user preferences and recommend items to the user. When the user is presented with these options, the choice that the user makes around whether to interact with this item or not is fed back into the recommender system. This creates a feedback loop that informs the future recommendations for the user. These feedback loop driven recommender systems can create scenarios where the user ends up in an “echo chamber” or a “filter bubble”. Whilst “<a href="https://www.merriam-webster.com/dictionary/filter%20bubble">filter bubble</a>” is a relatively newer term used mostly in relation to an online application, “<a href="https://www.merriam-webster.com/dictionary/echo%20chamber">echo chamber</a>” has been part of the common parlance for centuries and is an effect that can take place in humans interacting with each other as well. However, when it comes to an algorithm it can be tailored to a larger extent to a specific user and these personalized feedback loops can cause extreme cases of creating echo chambers and filter bubbles. This paper is a study of how recommender systems can be designed to slow down or avoid echo chamber and filter bubble effects.</p><p>The authors of this paper started out with defining the two terms to set the tone of the paper.</p><p><strong>Echo chamber:</strong> The phenomenon of repeated exposure to a particular item or category of items being recommended by the recommendation system affecting a user’s preferences via positive or negative reinforcement.</p><p><strong>Filter bubble: </strong>A metaphorical bubble that’s created by recommender systems filtering out content in order to only serve a limited subset of the available items as a recommendation to a particular user.</p><p>The interesting fact that the authors point out with supportive related work and research literature is that user interests are degenerative. Over time, we see the types of content that users interact with gets “narrower” over time. The only thing we can control with a recommender system is the speed of this degeneration process — and that’s what the rest of the paper is about.</p><h3>Model</h3><p>The goal of this recommendation system model is to recommend items that the user is interested in. The system has ways for the user to interact with it over time. Every time the user-model interaction happens, the system serves a set number of items to the user from a finite set of available items.</p><p>As the user interacts with the recommendations from this model, the model evolves and so do the user’s interests. For each recommendation presented, the user provides some feedback based on their interest which is then incorporated into existing model to create a new model that will be used to serve recommendations next time the user interacts with the model. Essentially, the new model has various different variables affecting it — the current model, the current recommendation and the feedback provided by the user. Also, the user’s new interest has a few variables affecting it as well — the current interest, the current recommendation and the feedback provided by the user (assuming that there are no external world factors affecting the user’s interests). The latter (how the user’s interests change) is of main importance for this paper.</p><p>Since the authors have set out to analyze echo chamber or filter bubble effect, they are most interested in the times when the user’s interest changes drastically such that the user’s new interest ends up being largely different from the initial interest, either positively or negatively. To simplify — if a recommendation shown to the user at time 0 had say interest level <em>x</em> shown by the user and at time t the same recommendation had interest level <em>y</em>, <em>y-x</em> being largely positive signifies user developed extreme interest vs <em>y-x</em> being largely negative signifies extreme dislike for the recommendation. This makes the user’s interest sequence over time <em>weakly degenerate. </em>In addition, if once the new interest has drifted away from current interest and it continues to stay that way, then there exists a stronger notion of degeneracy — the user’s interest sequence is <em>strongly degenerate.</em></p><h4>User Interest Dynamics — Echo Chamber</h4><p>In order to simplify the case for analyzing echo chamber effect, the authors took the approach of setting the number of items the system recommends at a time to be 1 and also setting the total set of available items to size 1. This helps isolate the recommender system’s influence from dynamics of user interest. Essentially, the question to answer here is: “what is the effect on user’s interest in a particular item if that item is served to the user infinitely often?”.</p><p>Weak degeneracy takes place if the user’s interest can drift up or down based on some threshold of feedback. Strong degeneracy occurs when the difference between the user’s current and new interest is bounded and for the difference between the two interests has positive or negative drift greater than a constant. Hence, the system considered for the simulations in the paper, the user’s interest degenerates under very mild conditions.</p><p>Thus, the user’s interest degeneracy can only be avoided by showing an item only finitely many times. If we want to show the item infinitely many times, we can only control the rate of degeneracy (and try to slow it down) but not avoid it.</p><h4>System Design Role — Filter Bubble</h4><p>In order to study the influence of recommender system actions in creating filter bubbles, the authors start with the assumption that the user’s interest has degenerative dynamics. In order to design a recommender system with the purpose of slowing down this degeneration process, the authors controlled three dimensions of the system: model accuracy, amount of exploration, and growing candidate pool.</p><p><strong>Model Accuracy</strong></p><p>Recommender systems are commonly designed to increase the accuracy of prediction model used for generating the recommendations. If we analyze the extreme case of 100% accuracy (or exact prediction) where the model is exactly equal to the user’s current interest, we call such a model as <em>oracle model.</em> Given this model and a greedily optimal surfacing of results, i.e. serving the top results that the user is most interested in at any given time, we end up with the quickest degenerating items being served most often and repeatedly over time.</p><p><strong>Amount of Exploration</strong></p><p>In a random exploration case where the top recommendations are picked from a finite pool of items with uniform noise on the model sequence, the larger the noise distribution is, the slower the system will degenerate. However, random exploration added to an oracle model will make it more likely to reveal the most positively degenerating items, accelerating the degeneration speed due to random exploration. Even in a case outside of oracle model, randomly recommending items will lead to some rate of degeneration due to the user’s interests degenerating slowly.</p><p><strong>Growing Candidate Pool</strong></p><p>If at every step, a new pool of candidate items becomes available, it becomes possible to serve all items only a finite number of times. In accordance with the <a href="https://en.wikipedia.org/wiki/Pigeonhole_principle">pigeonhole principle,</a> if the candidate pool is finite or growing sub-linearly, there will be at least one item that is served infinitely often. Hence, we need the pool to be growing at least linearly.</p><h3>Simulation Experiments</h3><p>The authors ran simulations for five different recommender system models with simple degenerative dynamics for the interest sequence in order to examine the degeneration speed under each model.</p><p>The five models used were:</p><p><strong>Random Model: </strong>Each set of recommendations is sampled from a uniform distribution over the entire candidate set.</p><p><strong>Oracle Model: </strong>The model matches the user’s interest exactly and serves a set of top items of interest.</p><p><strong>Optimal Oracle Model: </strong>Similar to oracle model but instead of top items according to the interest, it picks the fastest degenerating items. This model helps maximize both long term user engagement and degeneracy speed.</p><p><strong>Upper Confidence Bound Multi-armed Bandit Algorithm (UCB): </strong>With a bias towards exploration, this algorithm will favor serving items that haven’t been served before.</p><p><strong>Thompson Sampling Multi-armed Bandit Algorithm (TS): </strong>The model used for serving recommendations is sampled at every step from the beta distribution of two variables which are essentially functions of interest or disinterest (<em>1–interest</em>) in a particular item at a given time.</p><h4>Echo Chamber and Filter Bubble Effect</h4><p>The authors ran simulations on the above models with a candidate set pool size of 500 with a time horizon of 5000 to study the effects on echo chamber and filter bubble effects. At each time step, 5 recommendations are generated with each model and presented to the user.</p><p>The overall results were that <em>all </em>models caused degeneration of user interest, the only thing that varied was the speed of degeneration. In order of fastest degeneration to slowest, the models ranked: Optimal Oracle, Oracle, TS, UCB, and Random Model. For all models except Random Model, the observed results were that the top items served and top user interests narrowed down to the top 5 most positively reinforced items, demonstrating both an echo chamber and a filter bubble effect.</p><h4><strong>Speed of Degeneracy</strong></h4><p>Through the simulations, the authors also compared the speed of degeneracy for for the five models on both fixed and growing candidate pools. The effects of candidate pool size (for a finite pool), noise level, and growing candidate pool on the speed of degeneracy for each model were observed.</p><p><strong>Candidate Pool Size: </strong>The authors tested with various different sizes of finite candidate pool size. With the exception of Random Model, UCB slowed down the system degeneracy the most with a very large candidate pool size. This is likely due to the fact that UCB is forced to explore unserved items first. TS on the other hand has a weaker exploration notion of new items so it degenerates faster than UCB. Overall, as candidate pool size increases, the degeneracy speed of oracle and optimal oracle go up and that of Random Model, UCB and TS go down.</p><p><strong>Noise Level:</strong> In order to answer the question around how the model inaccuracy affects degeneracy speed, the authors tested Oracle model with different amounts of uniformly random noises. Adding noise increased the speed of degeneration since faster degeneracy items could then be selected by chance.</p><p><strong>Growing Candidate Pool: </strong>Different growth rates for the pool were tested. The findings were that while Oracle and Optimal Oracle are degenerate at all growth rates, Random Model and UCB stop degenerating at sub-linear growth and TS stops degeneration at linear growth. Overall, for all models, higher growth rate resulted in slower degeneration.</p><h3>Personal Takeaways</h3><p>My main takeaways from this paper were:</p><ul><li>Finite pool sizes should be avoided unless the pool size is very very large. If possible, linear growth model for the candidate pool is ideal.</li><li>Model accuracy is tricky — for Oracle or Optimal Oracle models, when the model is too accurate as well as when there is too much noise can both accelerate degeneration.</li><li>Don’t fear the unknown — exploration of the unserved items can be beneficial in slowing down the degeneracy speed.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f47e9f3b9bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How-to Guide: CNNs using TensorFlow / Keras / TensorFlow Serving in Google Colaboratory]]></title>
            <link>https://medium.com/@curioushruti/how-to-guide-cnns-using-tensorflow-keras-tensorflow-serving-in-google-colaboratory-878e5884d03?source=rss-376865ac8e98------2</link>
            <guid isPermaLink="false">https://medium.com/p/878e5884d03</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Shruti Sharma]]></dc:creator>
            <pubDate>Fri, 16 Mar 2018 23:14:10 GMT</pubDate>
            <atom:updated>2018-03-16T23:14:10.118Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*-r7EkRUvzkqDyyr2kwdeDg.png" /><figcaption>TensorFlow | Keras | Colaboratory</figcaption></figure><p>Google recently launched <a href="https://colab.research.google.com/">Colaboratory</a>, a tool that lets you run <a href="http://jupyter.org/">Jupyter notebooks</a> in the cloud by hooking them up with your Google Drive. This is a great step in making machine learning and data science accessible to everyone. Now it doesn’t matter whether you have a fancy computer or not, you can access all the tools you need right from your browser. It also makes collaborating on code with anyone you like as editing a document together in Google Drive.</p><p>For me, the best part is that I don’t have to install anything on my computer to get started. This came in very handy as I was designing a walk-through of how to train a <a href="https://www.tensorflow.org/">TensorFlow</a> image classification model (convolutional neural network or CNN) using <a href="https://keras.io/">Keras</a>, serve this model using <a href="https://www.tensorflow.org/serving/">TensorFlow Serving</a> and create a prediction service to run inference on images in real time. I put all the code in Colaboratory notebooks and now I don’t have to ask the audience to download a <a href="https://www.docker.com/">Docker</a> container with all the prerequisites — neat!</p><p>To sum it all up, Colaboratory is a means to an end. The end I hope for here is that you enjoy my three part series on how to train and serve a CNN model using TensorFlow (+Keras) and TensorFlow Serving, respectively. All the notes and explanations for each step are within the notebooks to keep them as self-contained as possible.</p><p>Before you open the Colaboratory notebooks linked below, you will need to sign up for Colaboratory (essentially link your Google drive to Colaboratory)using <a href="https://colab.research.google.com/">this link</a>. It’s super easy and non-intrusive, I promise. Let’s face it, you’d rather do this (and let Google do the work for you) than download some multi-MB Docker image that I put together (and have to debug all the issues yourself). If you’re new to Colaboratory, read the steps described after the links.</p><p><a href="https://goo.gl/mUBQ2G">Part 1: Convolutional Neural Network for Image Classification using TensorFlow and Keras</a></p><p><a href="https://goo.gl/qgsT1s">Part 2: Serve trained TensorFlow model using TensorFlow Serving</a></p><p><a href="https://goo.gl/N2acZe">Part 3: Prediction service using TensorFlow Serving API</a></p><p>Once you open the notebooks, you will see a preview of the notebook and you can click on “Open With Colaboratory” at the top or navigate to “Open With” drop-down and select “Colaboratory”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bc4r79f-5azGZ8fAaWQCZg.png" /><figcaption>Select “Open with Colaboratory”</figcaption></figure><p>At this point you will be able to see the code and saved output in the notebooks. You will notice that the “Insert” and “Runtime” menus are both inactive. In order to edit the code or run it yourself, you will need to copy the notebook to your own Google Drive. Click “File” → “Save a Copy in Drive…”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gnn8e9v4nadVjnRURPlJVQ.png" /><figcaption>Select “Save a Copy in Drive…”</figcaption></figure><p>A copy of that notebook will open in your Drive in a new tab of your browser. You can use this copy to edit and run the code as you see fit. To run all the cells, “Runtime” → “Run all” or shift+Enter to run the current cell.</p><p>PS — I suggest you open the notebooks in Chrome. Even though Colaboratory supports both Firefox and Chrome, I could not get my notebooks to open up in Firefox with the shareable link. 🤷‍♀️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=878e5884d03" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>