Skip to content

Cookies

We use cookies to enhance your experience. Learn more

ResearchPublication

Large scale image recognition for online trading platforms

Earlier work, a post written in 2020 by Selcuk Sandıkcı of Prosus. A model trained on more than five million images in almost 3000 categories tells what a listing on OLX’s trading platforms is from its pictures, to make it easier to find.

Four rows of paper on dark teal paper, like a tree of categories: one long strip on top, two strips under it, four under those, and eight small squares at the bottom. One square, and the strip above it, are red; the rest are cream and pale gray.

Where this comes from

This is a post on the Prosus AI Tech Blog, written by Selcuk Sandıkcı and published on 17 December 2020. It reports work for OLX Group, a division of Prosus whose trading platforms let people buy, sell and exchange used goods and services, with pictures from one of OLX Group’s companies. It is listed here as earlier work from Prosus’s AI team. What follows is from the post.

What the post asks

On OLX’s platforms, sellers post listings with a title, a description and pictures of the item, and buyers find them by typing a search. Search has to return the most relevant listings, and as few searches as possible should come back empty. To help it, the team set out to predict the category of every listing automatically, so that listings become easier to search.

At this scale that is hard. There are thousands of categories, most sellers are individuals who follow no listing standard, and the pictures vary widely across millions, or even billions, of images.

A deep neural network is trained to classify the pictures of listings. Its predictions for the listings in the database make an index, and together with what users do, such as their searches, the listings they click and the messages they send, the index maps searches to categories. The pictures can then serve search as an extra filter by category. A second way the post names is to learn embeddings of searches, listings and categories from the index and from user behavior. The post itself is about the image recognition.

The data and the model

The labeled images come from one of OLX Group’s companies: more than five million of them across almost 3000 categories, which the post reckons five times the size of ImageNet with almost three times its categories. The categories form a hierarchy more than five levels deep, and the images are spread over them unevenly.

The model is Inception ResNet V2, chosen for a good trade-off between accuracy and complexity. It joins inception blocks, small networks inside the network that run convolutions of different sizes and pooling side by side, with the residual connections of ResNet, which let much deeper networks be trained. It was trained in Keras with a TensorFlow backend.

  1. Start from ImageNet

    The weights come from a model trained on ImageNet, with a new last layer for the dataset’s own categories.

  2. Train the last layer

    Every other layer is frozen, and the last layer is trained for several epochs, until its training accuracy is high and levels off.

  3. Train the whole network

    All the layers are unfrozen and trained. The post says this lowers the risk of destroying the pre-trained weights and presumably shortens training.

What it found

top-1 mean prediction accuracy, on a test split of the dataset
62.5%
top-3 mean prediction accuracy
80.4%
top-5 mean prediction accuracy
85.6%
Selcuk Sandıkcı, Prosus AI Tech Blog, 17 December 2020

Many categories are fine-grained, such as gaming, wireless and Apple keyboards under Keyboards and Mouse. So the post also measures accuracy with each prediction collapsed to its parent higher up the hierarchy, where a gaming keyboard taken for a wireless one counts as right. It gives two measures: micro-average accuracy, the share of all images classified correctly, and macro-average accuracy, the plain average of each category’s accuracy.

micro-average accuracy, with categories collapsed to the second level
85%
macro-average accuracy at the same level
84%
accuracy with categories collapsed to the third level
76%
Selcuk Sandıkcı, Prosus AI Tech Blog, 17 December 2020

Accuracy rises as categories are collapsed to higher levels, as expected. Some mistakes come from categories that are hard to tell apart in pictures taken by people who are not professionals, such as a GPS and an iPad. Others are the model’s own, such as a massage bed taken for an Xbox One.

In production

The model runs on AWS SageMaker, behind endpoints built with SageMaker and TensorFlow Serving that scale automatically and answer HTTP POST requests. A listing’s category is the first step, and the team’s post on attribute extraction describes the next. A general model decides which specialized model to call: a picture it classifies as a watch goes on to a model that extracts a watch’s attributes. The post says these chains of models keep the work modular and easier to maintain.

What comes next

The post finds that the classifieds domain “presents unique challenges due to its extremely dynamic nature and diverse set of products and users”. It concludes that it might be more accurate to split the categories into smaller groups, such as consumer electronics, animals and transport, and train a model on each, and that data and networks of this size need training spread over several GPUs. It suggests training image embeddings from what users do, for visual search and recommendation. At the time, the team was moving to the EfficientNet architecture, with a family of models for different needs, from high accuracy to low latency with acceptable accuracy.

The post

Large Scale Image Recognition for Online Trading PlatformsSelcuk Sandıkcı. Prosus AI Tech Blog, 2020

Author

  • Selcuk Sandıkcı

References

  1. Large Scale Image Recognition for Online Trading PlatformsSelcuk Sandıkcı. Prosus AI Tech Blog, Medium, 17 December 2020
  2. Large scale image recognition for online trading platformsSelcuk Sandıkcı. Prosus, 17 December 2020
  3. Inception-v4, Inception-ResNet and the Impact of Residual Connections on LearningChristian Szegedy, Sergey Ioffe, Vincent Vanhoucke, Alex Alemi. arXiv, 2016

Keep reading

  • Publication

    One model for the whole home page

    A shopping app’s home page is filled by many recommenders, each tuned for its own slot. This model writes one page per person, per meal moment: the title, the subtitle and what to show. In a live test on one slot it brought 137% more orders from that list.

  • Publication

    New robots, old tricks: teaching robots to speak AI

    A post of November 2026 on a year of wiring Darwin, the Prosus humanoid robot. Five parts spoke five protocols, and the post asks what a robot should tell an AI agent about its actions before the agent can use it.

  • Method

    Meet the large commerce model

    Language models learn from text. Magnet Decision learns from what people search for, look at, buy and come back for. Here’s how it’s built.