Project · Engineering
Cork Sorting Machines
Industrialisation of 3 cork sorting machines: controller firmware, embedded inference, API and React interface.
- Ref.
- 02.01
- Period
- 2025 - 2026
- Status
- Completed
- Organization
- Verréo
- Stack
- C++
- Python
- React
- ONNX Runtime
- Docker
Key points
- 3 machines taken from contractors' prototypes to production-ready systems.
- Hardware-triggered capture + inference pipeline (1–5 cameras, <100 ms per camera).
- HID camera drivers and an error-checked serial protocol.
Context
ReyCorks is a Verréo project that sorts used wine corks so they can be recycled by material.
The corks are collected in bins like this one (Fig. 1), then go through sorting machines that photograph each cork and route it by material: natural, agglomerated or synthetic.
During my internship I built the classification model. This contract was about the machines around it.
Three machines
Three machines had been delivered by contractors as proofs of concept: they worked in a demo, not for hours on a production floor. My job was to make them reliable enough for production, and I rewrote their software from scratch, from the firmware to the operator's screen.
- The POC (Video 1): corks placed by hand pass under the camera.
- The pre-industrial machine (Video 2): one cork at a time through a lit tunnel.
- Picasso (Video 3): a feeder bowl lines the corks up on a conveyor.
I can only show the machines from the outside: the mechanics belong to Verréo and its partners. The software is what I owned.
From cork to decision
Each machine follows the most basic pattern in industrial sorting: detect, analyse, decide (Fig. 2).
- Detection. A controller drives the mechanics and sees when a cork is in place. It triggers the capture on 1 to 5 cameras, depending on the machine, through camera drivers I wrote (HID).
- Analysis. An embedded computer classifies the images, in under 100 ms per camera.
- Decision. The class goes back to the controller, which sends the cork to its bin. The two talk over a serial protocol I designed with error checking, so a corrupted message is detected instead of acted on.
The loop is fully asynchronous: while one cork is being analysed, the next ones are already detected and photographed, so several corks are in the machine at once. That is how it keeps up with at least one cork per second.
Software
Around that loop, I optimised the software by isolating what the sorting needs from everything else.
Faster models
The classification models had to keep up with the line. I exported them, quantised them (INT8) and optimised them for inference: 40 ms per image on a CPU, 2 to 3 times faster than before.
In production
Figures from a recent session on the pre-industrial machine, as the operator's interface reports them.
65/min
Corks per minute
99%
Average confidence
99%
Corks above 80 % confidence
82%
Manufacturers identified
Corks the machine cannot place (2 % here) go to a default output instead of a wrong bin.