
Client: Dopplle, United Kingdom
My roles: Project management, Mobile app & Server backend development
My roles: Project management, Mobile app & Server backend development


The full solution consisted of:
- An API that the phone app could call to request suggested tags about an image
- A neural network that could recognize clothes types
- A web scraper tool for getting labelled training images from the Internet
- A neural network training tool
- An colour analyzer that could output major colours found in an image

Using reinforcement learning to classify clothes types
The first problem that we encountered was that Dopplle, at that time, did not have enough of their own labelled image data to be able to successfully train their neural network. In order to solve this problem, I created a command-line tool in Python that could scrape publicly-available content from major on-line stores. The tool performed store search for selected clothes categories, downloaded product images and associated them with category labels such as "trousers", "hats", etc. The Dopplle and the scraped dataset were used as follows:- Training data: All scraped images + most of Dopplle images
- Validation data (used for fine-tuning the model during training): Dopplle-only images
- Test data (used to evaluate the final model): Dopplle-only images

The best-performing neural network could correctly classify 66% clothes images. Some clothes, such as Trousers, were recognized with over 80% accuracy, while others, such as Coats and Jackets, were only recognized 50% of times.
There were two reasons for the relatively low accuracy in some clothes categories: Mislabelled data and small dataset size. Especially the Dopplle dataset relied heavily on end-user labelling of their own images, which is why, for example, some "jackets" were labelled as "hoodies", some "shorts" were labelled as "trousers", etc. In addition, the best-classified categories were the most represented in the training data. For example, there were twice as many "trouser" images as "coats & jackets" images in the training data.
It was decided that more training would be performed later to increase network accuracy.
Building the colour analyzer
The job of the colour analyzer was to suggest the main and the secondary colour of a piece of clothes. My first step in building the solution was to do literature review of reinforcement learning approaches to this problem. I decided that none of the approaches had results that were good enough for our purposes. In addition, the black-box nature of neural networks means that they are difficult to debug.
Each output colour represented a number of colour shades. For example, "Navy" was setup as a few particular shades of dark blue, while "Teal" matched a number of blue-green colour combinations.
The algorithm was first calibrated and tested on simple images where the colour distribution was precisely known. In the image below, on the left, are some of the images that were used during this process, as well as the colour outputs that the colour analyzer produced.
The final analyzer worked on Dopplle clothes images with their backgrounds removed and examples of its results are shown on the right side of the image below.
