Inspiration
I wanted to learn how Recommendation Systems work. So, I tried building one myself to understand the nuances.
What it does
The user is shown four images of apparels. They can input whether they liked or disliked a particular apparel. Based on their input, the system will try to show the apparels which the user liked rather than the one they disliked.
How we built it
Generating Embeddings
- I used 512-dimensional embeddings, which were generated using a pre-trained neural network named VGG-16.
- Input to the network was resized images(512x512), and output was 512-dimensional embeddings.
Creating Clusters
- The dataset I used for testing had 24 classes, so we assumed that creating 24β50 clusters using k-means clustering would be a good starting point. And manual verification of clusters when choosing k as 40 showed items within the clusters formed were relevant to each other.
- It is also possible to find the optimal number of clusters using the Elbow Method or Silhouette Score, but I stuck with 40 total clusters.
Generating new images after user feedback
- I used a probability-based model to show the next set of images to the user. Letβs say at time step t_n; we get four images from clusters, Cn1, Cn2, Cn3, and Cn4 (ni may or may not be equal to nk).
- Suppose the user gives positive feedback to images from Cn1 and, Cn2, then we update the probability of selection from that cluster to πͺ*0.75/2; here, we have used two as a dividing factor because only two images were given positive feedback.
- In general, if k out of 4 images were given positive feedback, then we add the probability of selection from that cluster to πͺ*0.75/k. Here, πͺ(0<πͺ<1) is the factor by which we define recency bias.
- I also used the previous five votes with the factor of πͺi, where i indicates the timestep before the current step.
Note: Only 0.75 is used to update probabilities based on votes because I wanted an image from a random cluster with a probability of 0.25 so the user can explore what he might not have seen before.
Challenges we ran into
- Building the logic for recommendation and coding it was a tough task
- Building a working web app to showcase the project
Accomplishments that we're proud of
- Building and coding the probabilistic logic for recommendation
- Learnt Streamlit library for showcasing the data science proejcts
What we learned
- Streamlit module
- Transfer Learning
What's next for Apparel Recommender
- I plan on deploying it to the Azure
- I also want to improve the recommendation algorithm as it doesn't seem to work sometimes
Log in or sign up for Devpost to join the conversation.