Skip to content

Vernice Italia: the neural network that guesses the formula from the colour

Give it an RGB colour and it tells you how to mix it. Paint deserves a brain too.

Vernice Italia: client logo
Year
2023
Sector · Industria, Mobilità & IoTAI and automationCustom softwareCloud and architecture

The problem

A customer arrives with a colour and a number: an RGB value, the exact green of a brand or the shade of a facade that has already been painted. In the laboratory that number has to be turned into doses. Every paint comes from combining thirteen base mixes, and the relationship between the proportions and the colour that comes out is not linear: you lay down a sample, measure it, correct it, lay it down again. Every round costs laboratory time and material.

13base mixes to dose for every shade

That problem, though, Vernice Italia had already solved twenty thousand times. Every row in the historical archive is a pair: a colour, and the doses that produce it. Years of laboratory trials are, in effect, a labelled dataset. It is just that nobody had ever read it as one. It was consulted to look things up, not to learn from.

20,000historical formulas used as the training set

How we solved it

The network is a feed-forward model in Python with Keras, trained on the whole archive with preprocessing and data augmentation across the twenty thousand records. The desired colour goes in, the proportions of the thirteen mixes come out. Whoever formulates works from a dashboard: they enter the colour, receive a starting formula, and the laboratory begins from there instead of from nothing.

The flow in diagram form: the requested RGB colour enters the feed-forward neural network in Python and Keras trained on 20,000 historical formulas, which returns the proportions of the 13 base mixes; requests pass through an AWS SQS queue with workers on AWS Lambda.
From colour to doses: the network proposes the proportions of the thirteen mixes, and the laboratory starts from there instead of from the first plausible attempt.

Inference is not instantaneous, and that decided the architecture. The Node.js and TypeScript backend does not wait for the network: it puts the request on an AWS SQS queue, a Lambda worker wakes up, runs the script and writes the status and details of the run to DynamoDB. The React front end follows the status and shows the result when there is one. Monitoring in CloudWatch. No machine sitting switched on, waiting for requests that arrive in bursts or do not arrive for hours.

The results

The physical test does not disappear: in the end the colour still has to be laid down and measured. But it starts from the right point rather than from the first plausible attempt, and trials falling from many to few is the line you see on the bill.

TECHNICAL DEEP DIVE

The model is a feed-forward neural network in Python with Keras, with preprocessing and data augmentation over the database of 20,000 records. The backend is Node.js and TypeScript, handling the API and the workers; requests to the network go through an asynchronous serverless queue on AWS SQS and AWS Lambda: events on the SQS bus wake a Lambda worker that runs the AI script and updates a DynamoDB table with the status and details of each run. A React and TypeScript front end, with monitoring in AWS CloudWatch.

Stack: Python, Keras, Node.js, TypeScript, React, AWS SQS, AWS Lambda, DynamoDB, AWS CloudWatch

Got something similar in mind?

Tell us what you want to build and we will help you find the shortest way there.

Talk to us
RELATED WORK

Other projects you might like.

Back to all our work