TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Fashion Shopping with Nearest Neighbors

76 pointsby unixpickle2 months ago
I made this website with my wife in mind; it makes it possible to browse for similar fashion products over many different retailers at once.<p>The backend is written in Swift, and is hosted on a single Mac Mini. It performs nearest neighbors on the GPU over ~3M product images.<p>No vector DB, just pure matrix multiplications. Since we aren&#x27;t just doing approximate nearest neighbors but rather sorting all results by distance, it&#x27;s possible to show different &quot;variety&quot; levels by changing the stride over the sorted search results.<p>Nearest neighbors are computed in a latent vector space. The model which produces the vectors is also something I trained in pure Swift.<p>The underlying data is about 2TB scraped from <a href="https:&#x2F;&#x2F;www.shopltk.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.shopltk.com&#x2F;</a>.<p>All the code is at <a href="https:&#x2F;&#x2F;github.com&#x2F;unixpickle&#x2F;LTKlassifier" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;unixpickle&#x2F;LTKlassifier</a>

13 comments

araes2 months ago
I actually found this product most interesting, perhaps oddly, for voyaging far afield from the fashion preference.<p>Picture leads to books leads to toys leads to ... a television that emits heat like a fireplace. I actually kind of want a television that emits heat &#x2F; cold in response to what&#x27;s on television (the product was just a tv fireplace that made heat).<p>Notably, like others have pointed out, and the author already addressed, the model definitely starts giving some rather &quot;strange&quot; results when you travel far away from the central training theme. Just click on a kid&#x27;s hoverboard, and it gives me vacuum cleaners and leaf blowers. Dinosaur toy, and not a dinosaur in the results.<p>They&#x27;re still interesting, and the main idea of having a &quot;variety&quot; slider with nearness of similarity was a cool feature for image browsing like most image searches. Be kind of nice if some browser image searches would let you have a &quot;variety&quot; or &quot;nearness&quot; slider when you&#x27;re just looking at similar images.
评论 #43376512 未加载
IgorPartola2 months ago
I love this kind of “reaction decision” process. I have a hard time styling things until I see them and importantly when I see examples of what I don’t like.<p>Also this is what I imagine Stitch Fix uses for their stylists. I wish there was a polished stylist service that didn’t also have me buying clothes from them. I don’t need a $60 white T shirt or a $120 basic jean jacket but I do want to have styles that look good specially for me.
评论 #43374982 未加载
crusty2 months ago
This is interesting but seems price independent. I get that since nothing is final, they&#x27;re all just more nodes, artificial restrictions based on price might limit the pathways to a match that might fit the users price parameters. But if a user has a budget, some items will only ever be intermediary nodes, while others are also potential purchases. I wonder if it would be computational trivial to highlight this distinction visually, so a user can easily distinguish between items to consider for purchase and items they will only see as refinement.<p>Our feels like there&#x27;s a bit of a gamification in just clicking one more time, like &quot;I like this, but if I click one more, maybe I&#x27;ll like something in the next set even more.&quot; And repeat forever - like a great (window) shopping tool that doesn&#x27;t result in much buying. But I&#x27;m not a shopper&#x2F;consumer, so maybe my impression is not representative.
itake2 months ago
If you chose a photo of socks pointing left, then the nearest neighbors are socks also pointing left.<p>I’d think the model should focus on the patterns and cut, not which way they are laying for the marketing photo.
评论 #43375828 未加载
abeppu2 months ago
It&#x27;s interesting to see how some ideas keep looping around. When I see this I&#x27;m reminded of a startup Modista from ~2008 which did visual-similarity for browsing fashion products. Here&#x27;s a writeup from a point when they did only shoes, but I know they expanded beyond shoes at somepoint: <a href="https:&#x2F;&#x2F;thenoisychannel.com&#x2F;2008&#x2F;11&#x2F;05&#x2F;modista-similarity-browsingfor-shoes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;thenoisychannel.com&#x2F;2008&#x2F;11&#x2F;05&#x2F;modista-similarity-br...</a><p>I think they died over legal issues with rights to product images.<p>But in the vibewall demo, I wonder if the embedding is capturing the right similarity concept for this application. E.g. in the results most similar to this men&#x27;s polo, I see a bunch of henleys, a women&#x27;s quarter-zip pull-over, a women&#x27;s full-zip fleece, a men&#x27;s tank, a women&#x27;s top with a plunging neckline, even a baby wrap! These are appropriate to be worn by different people in different social contexts and in different seasons. The main visual similarity seems to be that they include human upper bodies on white backgrounds? <a href="https:&#x2F;&#x2F;vibewall.shop&#x2F;?id=c43bc222-e68b-11ef-8208-0242ac110005" rel="nofollow">https:&#x2F;&#x2F;vibewall.shop&#x2F;?id=c43bc222-e68b-11ef-8208-0242ac1100...</a>
评论 #43375415 未加载
ResearchAtPlay2 months ago
This is great! I&#x27;ve forwarded the site to my wife.<p>Would you mind sharing how you trained the model to produce the vectors? Are you using a vision transformer under the hood with contrastive training against price, product category, etc.?<p>EDIT: I see that the training script is included in the repo and you are using a CNN. Inspiring work!
评论 #43373757 未加载
binarymax2 months ago
This is really cool. You might be interested in this talk which shows you can incrementally add some preference vectors as a way to improve the recommendation.<p><a href="https:&#x2F;&#x2F;haystackconf.com&#x2F;us2023&#x2F;talk-20&#x2F;" rel="nofollow">https:&#x2F;&#x2F;haystackconf.com&#x2F;us2023&#x2F;talk-20&#x2F;</a>
lavela2 months ago
Visiting the site first I was quite annoyed it always pushed me towards women&#x27;s fashion, which obviously makes sense reading your statement.<p>If anyone reimplements this for men&#x27;s fashion let me know! I think this tool is great for anyone who isn&#x27;t well educated in terms of fashion and I guess it is safe to say that this applies to men more often than to women.
thinkingemote2 months ago
Nice! I was going to ask about if the nearest neighbour algorithm gives less distance if a model has the same pose and then I realised that similar products (like a t-shirt) are shown with the same pose, so it shouldn&#x27;t be an issue.<p>&quot;hat&quot; gives a range of poses
评论 #43373406 未加载
fredophile2 months ago
Out of curiosity, what&#x27;s the size of vectors you&#x27;re using (# of dimensions) and what distance metric are you using? Euclidean?
评论 #43376847 未加载
whiplash4512 months ago
Very cool. Have you considered adding text-based search using CLIP-like embeddings?
评论 #43374212 未加载
lgvld2 months ago
in the same vein (not fashion-related): <a href="https:&#x2F;&#x2F;same.energy&#x2F;" rel="nofollow">https:&#x2F;&#x2F;same.energy&#x2F;</a>
6stringmerc2 months ago
So it just automatically uses location data fed by the user and doesn’t prompt? What are the terms of service on data collection?
评论 #43373668 未加载