2,000× Less Carbon for 93% of the Accuracy: What We Learned Building for L'Oréal

By Zyad Husseini · Data analyst and economist, France & Egypt

Most machine learning competitions score one thing: performance. The L'Oréal hackathon we entered scored three — F1, CO₂ emissions, and model size. That single change to the objective function changed every engineering decision we made, and it produced a result I still think about.

The task was multi-label classification of skin conditions from beauty product descriptions: 6,240 products, labels generated by an LLM, and a text corpus that was marketing copy rather than clinical language.

The insight that shaped the solution

Reading the data, we noticed the labels were not homogeneous. Some conditions were stated outright in the product copy — "for acne-prone skin" is not a prediction problem, it is a reading problem. Others had to be inferred from ingredients, claims and phrasing that never named the condition.

Treating those as one task means your model splits its capacity between extraction and inference, and does neither cleanly. So we split the labels into strong (stated) and weak (inferred), and gave each its own model. That one decision did more for our scores than any amount of hyperparameter tuning.

Two models, and the number that surprised us

We built both ends of the spectrum deliberately, to see what the trade-off curve actually looked like:

The heavyweight — a fine-tuned Longformer - 0.688 micro-F1 - 113.8 g CO₂ - 3.5 hours on a Tesla T4

The lightweight — TF-IDF into LightGBM - 0.638 micro-F1 (and 0.77 on the strong labels) - 0.05 g CO₂ - minutes on CPU

Run those numbers against each other. The lightweight pipeline delivered roughly 93% of the performance for about 1/2,000th of the carbon.

That ratio is the finding. Not "small models are fine" — that's a platitude — but the specific shape of the curve: the last 7% of F1 cost three orders of magnitude more emissions than the first 93%.

Why the strong-label score matters most

Look again at 0.77 on strong labels. The cheap model was very good at the subtask that was really extraction, and mediocre at genuine inference. The Longformer's advantage was concentrated almost entirely in the weak labels.

Which tells you how to deploy this in production: run TF-IDF/LightGBM across the whole catalogue, and reserve the transformer for the subset where inference is actually required. You buy the transformer's advantage only where it exists, instead of paying for it on every row.

That is a routing architecture, and the only reason we found it was that the scoring function forced us to look at cost per unit of accuracy rather than accuracy alone.

Presenting it at L'Oréal in Paris

We presented the work at L'Oréal headquarters in Paris. The question that landed hardest was not about the modelling — it was about what the carbon number meant at catalogue scale. 113.8 g against 0.05 g is a rounding error for one training run. Multiply by every retraining cycle, every catalogue refresh, every market, every year, and the ratio stops being academic.

This was a five-person team project for Machine Learning 2 at Kedge Business School, and it is the clearest example I have of a constraint improving an engineering outcome. If the brief had scored F1 alone, we would have fine-tuned the largest model that fit in the time budget, reported 0.688, and never discovered that 93% of it was nearly free.

The transferable lesson

Add cost to your objective function before you start, not after you ship. Teams that measure only quality optimise only quality, and then discover the bill.


More of my work — including my MSc thesis on predicting in-game spending and econometrics research on renewable energy and growth — is at zyadhusseini.com.

I'm Zyad Husseini, a data analyst and economist working between France and Egypt. LinkedIn · GitHub