Leila saw the lamp in the background of a photograph, on a shelf behind somebody being interviewed about something else. It had a ribbed glass shade the colour of weak tea and a short brass stem. She did not know the maker, the period or what such a thing was called.
Ten years ago that would have been the end of it. She could have typed "brown glass lamp ribbed" into a search box and scrolled through thousands of the wrong lamps. Instead she cropped the photograph to the lamp and gave the image to a search tool. In a couple of seconds it returned a page of ribbed glass shades in amber and smoke, several nearly identical, with the name of a style she had never heard and three shops that sold one.
What happened in those two seconds is among the more elegant ideas in modern computing, and it explains both why the results were so good and why two of them were of a jelly mould.
Pictures as places
A computer cannot compare images as we do. It can compare numbers. So the trick is to turn each image into a list of numbers such that pictures that look alike get lists that are numerically close.
This is done by a neural network trained on enormous numbers of images. An image goes in. Layer by layer the network detects edges, then textures, then parts, then whole forms. Near the end, before any final label, the image has been reduced to a list of several hundred numbers. That list is called an embedding.
It helps to think of the list as coordinates. With two numbers you can mark a point on a map, and with three you can place it in a room. With five hundred you can place it in a space that cannot be pictured and that obeys the same rule: similar things are near each other.
In such a space all the ribbed amber glass shades are in one neighbourhood. Smooth amber shades are next door. Ribbed clear glass is a short way off in another direction. Brass table lamps with fabric shades are further, and photographs of dogs are a long way away.
How the network learns what "similar" means
Nobody tells the network which features matter. It is trained by examples, and the kind of example shapes the result.
One common method shows the network three pictures at a time: an anchor, another image of the same product, and an image of a different product. The network is adjusted so that the first two end up closer together than the first and the third. Repeat with millions of triplets, including photographs of the same item taken by customers in poor light and at odd angles, and the network learns to place the same object near itself, whatever the conditions.
Another method, which has become very influential since 2021, trains on images paired with their captions. The network learns to put a picture and the text describing it close together in the same space. A system trained in this way can be searched by image, by words, or by both. It is why you can now give a search tool a photograph and add "but in green".
Finding the neighbours
A large retailer may have hundreds of millions of product images. Comparing a query against every one would be too slow. So the embeddings are stored in an index built for approximate search, which finds very probably the closest points without examining them all. The answer comes back in milliseconds.
The whole pipeline for Leila's lamp was therefore:
- Detect the object in her picture and crop to it.
- Convert the crop to an embedding.
- Find the nearest embeddings among the catalogue.
- Rank them, often adjusting for price, availability and what similar shoppers went on to buy.
- Show the results.
Why the jelly mould?
Because, in the terms the network had learnt, a ribbed amber glass jelly mould photographed from the side is extremely close to a ribbed amber glass lampshade. It has the same material, colour and fluting, and nearly the same outline.
The system matches appearance. It has no concept of function. It did not know that Leila wanted something to light a room. A person would never confuse the two, because we see objects in terms of what they are for.
This is the general character of visual similarity as machines compute it, and it has a few predictable consequences.
Surface over structure. Colour, pattern and texture dominate. A linen shirt and a linen-look polyester shirt are neighbours. So are a solid oak table and a laminate printed with oak grain. The properties that determine quality are often invisible in a photograph.
The photograph is part of the match. Lighting, background and angle leak into the embedding. A chair photographed in a white studio may match other studio shots better than the same chair in a living room.
Scale is lost. A doll's house chair and a full-size one are the same shape.
It finds what is common. The neighbourhood of a mass-produced item is crowded with near-copies. The neighbourhood of something unusual, handmade or old may contain nothing close, and the system will return the least dissimilar things it has, without telling you they are poor matches.
It can find the copy as easily as the original. Search with a photograph of a designer's piece and the nearest results may be imitations. That is convenient for the bargain-hunter and a serious problem for the designer.
Getting better results
A few habits make a large difference.
- Crop tightly to one object. A picture of a whole room gives the system several things to choose from.
- Use a plain view if you have a choice. Front or three-quarter, well lit, unobstructed.
- Add words. If the tool allows text with the image, supply what the picture cannot show: "table lamp", "1970s", "wool", "under 200". Function and material are where the image alone is weakest.
- Search the result. When a near match turns up with a proper name attached, a style, maker or pattern, switch to searching for that name. The picture got you the vocabulary, and words are still the more precise instrument.
- Try more than one tool. A general search engine draws on the whole web and is best for identifying something. A retailer's own tool only knows its catalogue.
- Verify the object. For anything expensive or second-hand, a visual match is the start. Dimensions, materials and maker's marks have to be checked in the usual way.
Similar is not the same as right
There is a broader thought here for anyone interested in style.
A similarity search answers the question "what else looks like this?" That is useful when you want that lamp, or one like it. It is less useful when the real question is "what would go with this?" A room in which everything is a near neighbour of everything else is merely matched. The combinations people admire usually involve some distance: rough beside smooth, old beside new, a colour that should not work and does.
Systems are being built to learn compatibility as well as similarity, by training on outfits and rooms that people have put together. They capture conventional pairings reasonably well. The unexpected pairing that makes a room is, by definition, rare in their data.
Leila found her lamp. It was a Scandinavian design from the 1960s, and a second-hand one arrived three weeks later. She put it on a painted green chest of drawers, beside a rough clay bowl. No search would have suggested that arrangement, since the three objects have nothing in common.



