"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;
Showing posts with label Recommendation Systems. Show all posts
Showing posts with label Recommendation Systems. Show all posts

February 01, 2024

Video Recommendation System

  • Interest-based recommendations by signup
  • Content-based - System that follows videos watched
    • Similar videos based on content
    • As interest changes, content changes, adaptive strategy
  • Collaborative, Recommendations based on other people similar to me
    • Watch history based on users in clusters
    • A model trained as a batch job 
  • Two-tower approach (based on neural network)
  • Batch, Online training, Ranking
  • Model updated in real-time
    • Recent changes are updated in real-time

  • Vectors from video data - Indexing videos


  • Videos - Index creation - Vector Embeddings
  • Online + Offline Systems





Keep Exploring!!!

November 07, 2023

YouTube recommendation systems

Some papers need more iterations to learn the basics. Summary from link 

Patterns

  • Episodic series are usually watched sequentially
  • Users often discover artists in a genre beginning with the most broadly popular before focusing on smaller niches
  • Balancing new content exploration/exploitation perspective.
  • If a user was recently recommended a video but did not watch it then the model will naturally demote this impression on the next page load

Approach

  • YouTube videos, split into two distinct problems: candidate generation and ranking
  • YouTube activity history
  • Shortlist small subset (hundreds) of videos from a large corpus
  • Broad personalization via collaborative filtering
  • Similarity between users - video watches, search query tokens, demographics
  • Similarity of Features describing the video and user
  • Ranking network accomplishes this task by assigning a score to each video according to a desired objective function

  • Recommendation as extreme multiclass classification where the prediction problem
  • Embeddings of each candidate video
  • Deep neural network is to learn user embeddings u as a function of the user’s history and context that are useful for discriminating among videos with a softmax classifier
  • Explicit feedback mechanisms exist on YouTube (thumbs up/down) + implicit feedback of watches
  • Magnitude of implicit user history / feedback is extremely sparse
  • Traditional softmax vs hierarchical softmax 

Features used

  • Video watches, search query tokens, demographics
  • Feedback mechanisms 
  • implicit user history when feedback is extremely sparse
  • Demographic features 
  • User’s geographic region and device
  • User’s gender, logged-in state and age

Scaling Lessons

  • Previous systems at YouTube relied on hashing
  • Scoring problem reduces to a nearest neighbor search in the dot product space
  • Previous linear and tree-based methods for watch time prediction

Feature Engineering

  • A user’s watch history is represented by a variable-length sequence of sparse video IDs which is
  • mapped to a dense vector representation via the embeddings
  • Network requires fixed-sized dense inputs

Algorithms

  • If users are discovering videos through means other than our recommendations, we want to be able to quickly propagate this discovery to others via collaborative filtering.


Ranking

  • The primary role of ranking is to use impression data to specialize and calibrate candidate predictions for the particular user interface. 
  • Assign an independent score to each video impression using logistic regression
  • Ranking with watch time better captures engagement

Feature Representation

  • Binary (e.g. whether the user is logged-in) 
  • millions of possible values (e.g. the user’s last search query)
  • Features are further split according to whether they
  • Contribute only a single value (“univalent”) or a set of values (“multivalent”)
  • An example of a univalent categorical feature is the video ID of the impression being scored
  • multivalent feature might be a bag of the last N video IDs the user has watched
  • A univalent feature in machine learning would be a feature that can assume only one value or has only one dimension
  • If you have a dataset with a feature called "IsEmailVerified," it could potentially be a binary feature signifying whether a user's email is verified (1) or not (0)
  • A multivalent feature would be a feature that can have multiple values or dimensions. 
  • For example, a feature representing "VehicleType" could have multiple categories like "Car," "Truck," "Bike," and "Bus," each representing a different mode of transportation.
  • "Color," which could encode the color of an item as an RGB tuple (Red, Green, Blue).

Deep ranking network architecture

  • univalent and multivalent features
  • All layers are fully connected. In practice, hundreds of features are fed into the network.



Embedding

  • Categorical features in the same ID space also share underlying emeddings.
  • Out-of-vocabulary values are simply mapped to the zero embedding

CHATGPT4 Support

  • Define the user and video embeddings (simulating the learned embeddings from the actual system).
  • Simulate the function recommend_videos that scores and ranks videos for a user based on their embedding.
  • Implement the softmax function for the recommendation score.
  • Provide sample usage of the recommendation function using dummy data.

softmax vs hierarchical softmax with python example

The key takeaway is that while softmax calculates probabilities across all possible classes, hierarchical softmax does it for a specific path in a binary tree, reducing the computation when dealing with a vast number of classes.

Softmax Probabilities: The softmax function has converted the logits ([2.5, 1.0, 0.5]) into probabilities ([0.73612472, 0.16425163, 0.09962365]), which sum to 1.

Hierarchical Softmax Probability of a Class: The hierarchical softmax has calculated the probability for the class represented by the path 'LL' (left, left), which is (0.6 \times 0.8 = 0.48).


Keep Exploring!!!

March 24, 2023

AWS - Personalization - Good Read

Personalize cross-channel customer experiences 

Key steps

  • Collect data from multiple sources to store in Amazon Simple Storage Service (Amazon S3).
  • Use AWS Step Functions to orchestrate data onboarding and feature engineering.
  • Build segments and predictions using SageMaker.
  • Use propensity scores for display targeting.
  • Send personalized messaging using Amazon Pinpoint.
  • Integrate real-time personalized suggestions using Amazon Personalize.

Code Examples - Link


User Segmentation - Link, Amazon Personalise

Data sources connect to AWS Kinesis Link



Build, tune, and deploy an end-to-end churn prediction model using Amazon SageMaker Pipelines

Keep Exploring!!!

August 15, 2022

Summary Fashion Attributes

Clothing Recommender System

  • Part I : Object Detection
  • Part II : Attribute Tagging
  • Part 3 : Recommendation based on Frequency

Fashion Meets Computer Vision: A Survey


Paper #1 - Progressive Fashion Attribute Extraction

  • Attributes (neck design detailing, sleeves detailing, etc) 



Paper #2 - Attr2Style: A Transfer Learning Approach for Inferring Fashion Styles via Apparel Attributes

  • Low-level attributes of an apparel (for example, neck type, dress length, collar type, print etc)



  • Transfer learning based approach to address the issue of style-based image captioning for a target dataset

Paper #3 - The iMaterialist Fashion Attribute Dataset




Paper #4 - A Deep-Learning-Based Fashion Attributes Detection Model


Paper #5 - FashionSearchNet-v2: Learning Attribute Representations with Localization for Image Retrieval with Attribute Manipulation



Myntra Customization



Occasion based Recommendation system in E-commerce like Amazon, Etsy

Visual Attributes for Fashion Analytics

We use low-level visual features to predict intermediate clothing attributes such as color, pattern, material, or collar type Occasion-oriented clothing recommendation

Attribute Types

Color/ Attributes





More Reads

Fine-Grained Fashion Similarity Prediction by Attribute-Specific Embedding Learning

Keep Exploring!!!

August 12, 2022

Wide eyes - Vision Product Analysis

Wideeyes  link

Feature #1 - Search By Image (Similar image search :))

Input - Image

Technical details

  • 1000 different attributes, thus is able to connect different types of fashion images Real-time, fully automatically

Result - Results of the most similar in-stock matches of outfit

Feature #2 - Similar Recommendation (Transaction-based similar items)

Input - Most similar products to the one the customer is viewing

Technical Details

  • Personalize the results for every shopper (size, brand style, etc.)
  • Business rules (price range, campaigns, stock by country, area, store, etc.).

Result - Similar images based on current browsing data and metadata configuration

Feature #3 - STYLE ADVISOR (Similar to cross-category bundle)

Input - Browing / Purchase databased

Technical Details

  • Fully automated complete outfit based on a single product.
  • Perfect outfit recommendations and increase the shopping basket.

Result

  • Worn together, Fit together recommendations
  • Complete The Look 

Feature #5 AUTO-TAGGING

Input - Image

Tech Details - 300 high-quality tags based on images, adapted to more than 60 categories (apparel, jewelry, and fashion).

Attributes - Gender / Category / Color / Shape 

Result - Autotagging recommendations and Automating noise detection in image

My Feedback - Basically good amount of detection / classification / styles / category mapping. They have models built but customized based on customer dataset

Datasets Link1, Link2

Memory-efficient embeddings for recommendation systems

Keep Exploring!!!

July 20, 2022

Recommendation Systems

A Review of Modern Fashion Recommender Systems

  • Key Notes
  • Recommender systems have grown to be an essential part of all large Internet retailers, driving up to 35% of Amazon sales [103] or over 80% of the content watched on Netflix [31].
  • Localizing fashion items
  • Determining their category and attributes
  • Degree of similarity to other products
  • Product-to-product relationships
  • Product-to-user uncertainties
  • Fashion item compatibility - associated image and text data is then used to learn to generalize to stylistically similar products
  • The fashion item recommendation task, similar to the classical recommendation problem, focuses on suggesting individual fashion items (clothing), that match users’ preferences.
  • Fashion pair and outfit recommendation: Fashion outfits are sets of 𝑁 items that are worn together, e.g., for an outdoor wedding, graduation party, baby shower, and so forth
  • Modeling outfits as a sequence. to take advantage of the representation of order-aware models such as LSTMs
  • Fashion Item Relevancy network (FIR) learns the compatibility of fashion items and learns garment item relevance embeddings
  • Physical body-related features. The easiest way to make effective sizing recommendations is to use data from certain parts of the body [58, 60] such as bust, waist, and hip
  • User-item fit feedback. To provide personalized size recommendations, the interaction between the user and the item is essential

  • Color. The most common means to identify how one looks is achieved via colors, materials, and silhouettes on the body
  • Brand. Product brands are a critical feature users consider when deciding among items.
  • Texture. The texture describes the body and surface of a garment. 
  • Context = image + text. In addition to images, users may also include words (textual descriptions) to aid in the recommendation process
  • Context = image. Images are an important visual tool for users to communicate with a fashion recommender system

Toward Explainable Fashion Recommendation

  • Influence of the itemfeature pair, which we call its Item-Feature Influence Value (IFIV)
  • CNNs trained for generic image recognition are used to extract features for their respective purposes. 


Fashion Recommendation and Compatibility Prediction Using Relational Network

  • Learning compatibility between "tops" and "bottoms" Treating outfits as a sequence and using an LSTM-based mode

Single-Item Fashion Recommender: Towards Cross-Domain Recommendations

  • Category: Defines the main category of an image, such as top, bottom, footwear, and jewelry.
  • Subtype: Defines subtypes of the same category, such as boots, high heels, college, and slippers.
  • Fabric/Texture: Shows the main fabric or garment’s texture, such as denim, leather, smooth, and shiny.
  • Color: Defines the dominant color of the item, such as red, green, blue, yellow.
  • Variety: The number of novel items (different category, subtype, or color). Almost on the opposite side of the other criteria, because the higher the variety score is, the lower other scores will be.
  • Details: The number of results that follow fine details, such as necklines, zipper, pockets, and design.
  • Shape Difference: The number of items that do not follow the outline of the query item, such as images with different angles, different perspectives, rotations, flips
Key Concepts
  • Data generation
  • Embedding generation
Similarity
  • Cosine
  • Euclidean
Data Size Reduction
  • SVD
  • NMF


The tradeoff between batch vs realtime



  • What is computed prior? 
  • What is used in real time to adjust prior recommendations?



  • Offline - creating embeddings for catalog items, and building an approximate nearest neighbors (ANN) 
  • Online - converting the input item or search query into an embedding, followed by candidate retrieval and ranking



Transitioning to a real-time serving system has been made possible by two products: Feature Store and Online Inference Platform


July 04, 2022

Recommendation Systems

Bookmark of Repos for my ongoing learning

Deep Learning based Recommender System: A Survey and New Perspectives





High level thoughts

  • Data connectors class
  • SVDclass - Dataload - Algorun - Validate - Results
  • NMFclass - Dataload - Algorun - Validate - Results
  • ItemItemrecomclass - Dataload - Algorun - Validate - Results
  • UserUserrecomclass - Dataload - Algorun - Validate - Results

Structuring Your Project

Keras Reads

July 5th Updates

July 03, 2022

Personalized - Redefined - Recommendations - Paid Service

What if we get a customized recommendation based on our needs than based on what we are forced to see. 

Workday recommendations (Articles / Videos based on interests)

  • Data Science (20%)
  • Startups (20%)
  • Stock markets (20%)
  • Travel Vlog (10%)
  • Paranormal Vlog (5%)
  • Food Vlog(5%)
  • Emotions / Wellness (10%)

Weekend Recommendations

  • Travel Vlog (20%)
  • Paranormal Vlog (20%)
  • Food Vlog(10%)
  • Emotions / Wellness (20%)
  • Music (30%)

Tired of seeing the same swiggy ads, zomato ads, irrelevant to the context ads.

Ref - Link


Keep Thinking!!!

October 10, 2021

Forecast - Planning - Recommendations - Paper Reads

Paper #1 - Maximizing Store Revenues using Tabu Search for Floor Space Optimization

Key Notes

  • Floor space is a valuable and scarce asset for retailers
  • Connected multi-choice knapsack problem with an additional global
  • constraint and propose a tabu search based metaheuristic that exploits the
  • multiple special neighborhood structures
  • Over the last decade, the number of products competing for limited space increased by up to 30%
  • The product mix of categories, merchandising rules, sales patterns and characteristics of display furniture 
  • (1) develop a statistical model to measure the space elasticity; and 
  • (2) formulate and solve an optimization problem for each store to determine the optimal assignment of planograms to maximize total revenue subject to certain business constraints

Paer #2 - Reversing ShopView analysis for planogram creation

Key Notes

  • ShopView can build the planogram without the need of manually creating it in software
  • OCR in the identification of products
  • Planograms specifies the absolute physical locations of the products, and the amount of space each type of product should occupy
  • Planogram compliance using template images
  • Vision - Object Recognition based on attributes, Template and Feature Matching, Optical Character Recognition (OCR)
  • Custom Dictionary - Implementing a custom dictionary for the OCR engine seemed a good strategy since at first glance it would improve the performance of the OCR algorithm

Paper #3 - Deep Learning based Recommender System: A Survey and New Perspectives

Key Notes

  • Collaborative €ltering makes recommendations by
  • learning from user-item historical interactions, either explicit (e.g. user’s previous ratings) or implicit feedback (e.g. browsing history)
  • Content-based recommendation is based primarily on comparisons across items’ and users
  • Hybrid model refers to recommender system that integrates two or more types of recommendation strategies
  • Strengths of deep learning based recommendation models - Nonlinear Transformation, Sequence Modelling

Paper #4 - Fashion Retail: Forecasting Demand for New Items

Key Notes

  • Merchandising Factors - Discount, Visibility, Promotion
  • Derived Features - Age of Style, Trend and Seasonality, Cannibalisation

Paper #5 - Time Series Forecasting With Deep Learning: A Survey

More Reads

Keep Exploring!!!

September 26, 2019

The Curse of Cheap Data Plans

Many time I wonder cheap data plans are a curse, not a boom. I see more often these days
  • More time I personally spend on Youtube
  • Forwards of TikTok/ Halo Status videoes
  • Rechecking same repetitive news everywhere
I have lost a lot of sleeping hours. Google Youtube recommendation is the most unfair recommendation. Providing extremely similar recommendations. There is no mix of different sources. Sometimes tailored information is not what we need, we need the raw data.

Too much of personalization is a curse. You will lose yourself biased on your perspectives. Sometimes raw information makes more sense than tailored information.

Escape the Web!!!

August 15, 2015

Recommendation Algorithm Analysis

Item to Item Rating based on customer’s purchase of products


The formula for comparison is dot product divided by product of vector lengths
In the example for two sets Book and DVD
  • Book – (1,1,1) – Set A consider it as (A1, A2, A3)
  • DVD – (1,0,0) – Set B consider it as (B1, B2, B3)
Formula works as
  • (A1.B1 + A2.B2 + A3.B3) /sqrt((A1 square + A2 Square + A3 Square)( B1 square + B2 Square + B3 Square))
  • (1)/sqrt((3).sqrt(1)
  • 1 / 1.732
  • 0.577
     Item to Item Comparison based on customer ratings

The formula for comparison is dot product divided by product of vector lengths
In the example for two sets Book and DVD
  • Book – (4,3,5) – Set A consider it as (A1, A2, A3)
  • DVD – (1,0,0) – Set B consider it as (B1, B2, B3)
Formula works as 
  • (A1.B1 + A2.B2 + A3.B3) /sqrt((A1 square + A2 Square + A3 Square)( B1 square + B2 Square + B3 Square))
  • (4)/sqrt((16+9+25).sqrt(1)
  • 4/7.07
  • 0.565
Analysis - By comparing multiple items the items that yield the maximum value would be recommended to the customer

Happy Learning!!!