NLPHackathon

L'Oréal Product Classification

Led a team of 5 to tag 6,240 L'Oréal product descriptions with 33 labels (skin concerns, skin type, age, routine step): 78% weighted F1 with RoBERTa-large, then distilled it into DistilRoBERTa with 77% fewer parameters while keeping 97.6% of its weighted F1.

PythonRoBERTaDistilRoBERTaPyTorchCodeCarbon

Overview

A product classification model built for the L'Oréal and KEDGE Hackathon (Jan 2026, L'Oréal, Paris, France).

Team: 5 people. I was the team lead.


The Problem

L'Oréal gave us 6,240 labelled product descriptions. Each product is tagged with the labels it suits, out of 33 in total: skin concerns, skin type, sensitivity, age group, gender and routine step (about 4 per product). The brief: run a sustainable ML model that recreates those labels from the description text as accurately as possible.


Approach

  • Fine-tuned RoBERTa-large as a multi-label classifier, with a tuned decision threshold per label
  • Distilled it into DistilRoBERTa (knowledge distillation): a smaller student model trained to mimic the large teacher's predictions
  • Quantised the student to INT8 for a smaller saved model
  • Tracked emissions with CodeCarbon for every training run

Results

Before splitting, rare age and gender labels were oversampled, taking the 6,224 cleaned descriptions to 6,745 rows. Scores are on a 20% test split of those rows (1,349). Weighted F1 averages the per-label F1 scores, weighted by how often each label appears. Jaccard is the overlap between the predicted and true label sets for each product.

ModelWeighted F1Macro F1JaccardParametersSaved sizeTraining timeTraining emissions
RoBERTa-large (teacher)78.2%77.0%55.8%355M1,360 MB214 min0.0318 kg CO₂
DistilRoBERTa (student)76.3%74.5%52.6%82M190 MB (INT8)10.9 min0.0011 kg CO₂

The student keeps 97.6% of the teacher's weighted F1 (96.8% of its macro F1) with 77% fewer parameters.

What the savings compare

  • Training time (−95%) and training emissions (−96.5%) compare training the student with training the teacher. Distillation needs the teacher trained first, so these figures do not include the teacher's own 214 minutes and 0.0318 kg CO₂. Across the whole pipeline, distillation costs more to train than the teacher alone.
  • Emissions were measured with CodeCarbon during each training run.
  • The lasting benefit is at prediction time. The student is about 4× smaller, and 190 MB once quantised versus 1,360 MB, so every prediction needs much less compute. We didn't benchmark prediction speed during the hackathon, so there's no milliseconds-per-prediction figure here.

Building something similar?

Let's talk about shipping AI agents and integrations with your clients.

Get in Touch