Size Recommendation System at Myntra
In recent years, online shopping has surged, revolutionizing how people purchase products and services. E-commerce’s convenience has reshaped consumer behaviour and the retail landscape. Unlike traditional stores, online shoppers often face sizing challenges, leading to hesitancy and missed sales. Myntra has been a pioneer in addressing size and fit challenges in India, leading the way with innovative solutions that have significantly enhanced the shopping experience.
Building on its leadership in this space, Myntra’s latest initiatives take these solutions to the next level, offering even sharper and more effective recommendations. Solving this complex problem requires a combination of various features addressing size and fit issues. This blog details Myntra’s approach to size and fit recommendations, including our solution, implementation, offline pipelines, online services, handling size recommendation leakages, A/B analysis and more, providing a comprehensive overview of our strategies and outcomes.
What is the solution being used at Myntra?
Personalized recommendations are generated using data science models, which rely on two main types of inputs -
- Past purchases of the user
- Size and fit inputs provided through the “Try Size Finder” questionnaire for users without purchase history
Image 1: Recommendation based on past purchases
Image 2: Recommendation based on user inputs
How have we implemented this solution?
We have implemented a Size Recommendation System (SRS) to personalize size and fit recommendations for Myntra users, enhancing their shopping experience. This end-to-end service provides real-time size recommendations based on user profiles, purchase history and inputs, ensuring a seamless and engaging buying process. System performance is monitored via dashboards with appropriate alerts.
Offline pipelines
The models tend to degrade over time due to drifts. To address this issue, we have established refresh cycles at suitable frequencies to maintain high coverage (frequency of size recommendations provided out of total requests) consistently. Offline pipelines are used to refresh vectors in the database, validate the new vectors against the refreshed DS models and prepare data for incoming online service requests.
-
Refreshed DS models, updated vectors and wheel files are stored.
-
Flow configurations that are defined by the engineers based on the business requirements are stored.
-
The automated offline pipelines pull these files during startup - — Wheel file with new models are validated — New vectors are processed into the desired format
— Output is pushed to database
Few of the product (style) vectors are also refreshed daily by these pipelines via jobs.
Online service
The always-on online service uses DS models and vectors pushed to the database by offline pipelines as an input to those models to generate size recommendations. It can handle BAU traffic and scale very well to the peak sale traffic, all within the defined SLA of 50 ms for the size recommendation service.
-
When the service is started/re-started, the models, wheel file and the config files are downloaded as a part of startup scripts.
-
Connection to the database is established and kept ready so that online requests can be served.
-
Whenever a request is received: — The desired set of vectors are fetched from the DB as per the flow defined in the configuration. — Pre-processing is done to choose the most suitable flow (based on the vectors fetched) to invoke the DS model to get size recommendation. — Once pre-processing is done and all the desired vectors are available, the appropriate DS model is invoked to generate size recommendations.
— The post-processing step converts the output in the desired json format and sends it back as the API response, which is used to display size recommendations on the app.
Image 5: Online Service
DS models that are invoked -
-
Personalized Size Recommendation (PSR) — In an order to make a customers purchase experience seamless, our PSR model provides size recommendations tailored to customers’ purchase history, relevant to the item they are viewing. For example, if a customer bought a shirt from Myntra within the last 2 years, the PSR model suggests a size specifically for shirts. Our model training approach involves the following steps: — Create a dense vector to represent product SKUs based on various style attributes such as Brand, Fit (Slim/Regular/Loose), Size (S, M, L), and more. This vector encapsulates vital characteristics of each product, enabling efficient analysis and recommendation processes. — Integrate the SKU dense vector with brand measurements and estimated user measurements from their past purchases, forming an input vector for the PSR model. This holistic approach combining style attributes and user-specific data allows us to customize size recommendations for each customer, enhancing their shopping experience.
— The PSR model computes probability scores for each available size corresponding to the specific style. Through analyzing these probabilities, we identify the size with the highest likelihood of offering an optimal fit, ensuring a tailored recommendation for each customer.
-
Meta Learning: The size recommendation provided by the PSR model is limited to articles that the customer has previously purchased. Hence, if a customer has bought a shirt but is currently browsing for trousers, the PSR model cannot offer a size recommendation. To address this limitation, we developed a novel model leveraging Meta Learning. Similar to the PSR model, the Meta Learning model generates learnable embeddings from product attributes and utilizes linear regression to predict the appropriate size. This approach expands the size recommendation capability beyond the customer’s purchase history, offering a more comprehensive sizing solution. The Meta Learning algorithm’s adaptability and broader context utilisation significantly enhance its effectiveness in providing accurate size recommendations.
-
Cross-Learning for First-Time Users: This model aids first-time users on our platform where no prior purchases have been made. First-Time Users answer questions related to the category they’re browsing; for instance, if browsing shirts, they answer topwear-specific queries. If the user has previously answered similar questions (e.g., T-shirt queries), this model utilises this data to recommend sizes for the shirt being browsed.
Image 6: First-Time user’s questionnaire flow
- Fit Score: This model is a wrapper around the size recommendations generated by the PSR or Meta Learning models. It aims at generating a fit percentage score for the product that a user is browsing.
Image 7: Fit Score as seen on Myntra app
Analysing Model Metrics and Conducting A/B Evaluations at Myntra
After training our models, we evaluate their performance using offline purchase data and real-time A/B tests before deployment. During A/B tests, we monitor key metrics to ensure the effectiveness of our size recommendation system:
- Adherence Rate: Measures customer confidence in buying the recommended size.
- Adhered Return Rate: Tracks returns due to size and fit issues despite following recommendations.
- Overall Return Rate: Measures the rate of garment returns regardless of the reason.
- Return Impact: Analyzes the financial impact of product returns due to sizing issues.
- Coverage: Indicates the frequency of size recommendations provided out of total requests.
- Revenue/Quantity per User (RPU/QPU): Observes increases in these metrics as coverage improves, suggesting that size recommendations help customers make confident choices and reduce cart abandonment.
How do we deal with size recommendation leakages?
There may be instances where we cannot provide a size recommendation due to issues like missing vectors, model failures or incorrect data. To address this, we’ve identified and instrumented all possible metrics related to recommendation leakages and created a monitoring dashboard. This dashboard helps us track leakage issues, identify root causes and rectify them promptly.
Image 8 : Performance and leakages
Summary
At Myntra, we recognize the evolving needs of our customers and the dynamic fashion industry. By investing in R&D and innovative technologies, we enhance the accuracy of our size recommendations. Our commitment is to provide personalized, precise sizing, boosting customer satisfaction and loyalty and simplifying the online shopping experience.
Many thanks to Tanya Soni, Madhurima Mandal, Vivek Kumar and Vikram Garg from the data science team who were pivotal in the work that we did on this in Myntra and helped with the Blog.
References
[1] Meta-Learning for Size and Fit Recommendation in Fashion