Blog · November 3, 2026 · by Maxime Carriere

A general-purpose optimisation platform for vision models: lighter, without retraining

Most vision models that reach a device were trained on a server and never slimmed down. They work, they are just heavier than they need to be. We built a platform that makes them lighter without touching the training, and this post covers what it needs from you, what it does and what comes back.

The data: only a validation subset

We never ask for your training set. It is the large, costly and often confidential part of a vision project, and nothing here retrains, so it stays with you. We need the trained model and a validation set, the few hundred labelled images you already keep to check it. Unlabelled images are welcome too, and need no labelling work, as long as they look like what the model will see in deployment.

Two boxes. At your company: a large training set, drawn as empty squares, that stays with you; a labelled validation set of 50 green squares, one square per ten images, sent with the model; and, optionally, 26 squares of unlabelled images. At Kernwerk, the labelled set is split once: about 15 %, 80 images here, ranks candidates during the search and is never used in the report; about 85 %, 420 images here, becomes the held-out images, never seen by the search, and every number in the report, the original model's too, comes from them. The unlabelled images go to calibration, which measures the value ranges INT8 needs.
What leaves your company, and how we use it. One square is 10 images; the counts are those of most of our classification tests.

The labelled set is split once. About 15 % of it, 80 of 500 images in most of our tests, ranks candidates during the search. The other 85 % is held out. The search never sees these images, but they pick the winner among the finalists, so its score can lean slightly optimistic; a third, untouched set would remove that. Every number in the report, the original model’s included, comes from them. The unlabelled images measure the value ranges INT8 needs.

The held-out images also set the precision. With 420 of them, small changes in accuracy are hard to tell from sampling noise, so the report gives a 95 % interval for every change, and a larger validation set narrows it.

What you give us Needed? What it unlocks
The trained model required FP16 and uncalibrated INT8: smaller, but the accuracy cannot be checked
A labelled validation set, a few hundred images required to check accuracy every technique in this post, each version checked on your data
Unlabelled images from your domain optional better calibration, and more labelled images kept for the final check
A training set optional, not used today fine-tuning and quantisation-aware training, later

Before changing anything, the platform measures your original model on your data, class by class, and catches upload mistakes such as a wrong class order or a forgotten normalisation, which quietly cost one of our test classifiers 2 percentage points of accuracy, 97.1 % down to 95.1 %.

The goal is a hard rule: a version that breaks it is never recommended, however small. This is why every model in this post keeps its accuracy. The platform offers a few goals, from “keep today’s quality, make it lighter” to “no measurable change”. All our tests used the first, and a version must meet every part of it:

  • the model’s accuracy drops by at most 1 percentage point: an original at 90 % must stay at 89 % or above. For segmentation and detection the same rule applies to their standard scores, mIoU and mAP;
  • no single class loses more than 2 correctly classified images in classification, counted on the smallest class, 3 percentage points of IoU in segmentation or 5 percentage points of AP in detection;
  • on COCO, the mAP on small objects drops by at most 2 percentage points.

Test set: 33 models across three tasks

One model cannot tell a flaw in the method from a quirk of its architecture, so we test 33 public, edge-sized model–dataset pairs across three tasks:

  • Classification, 17 pairs: dog breeds (Imagewoof), satellite images (EuroSAT), histology (PathMNIST).
  • Segmentation, 6 pairs: pets (Oxford Pets), everyday scenes (Pascal VOC), eyes.
  • Object detection, 10 pairs: COCO and Pascal VOC.
Three groups of models flow into one optimiser and out as reports. Classification, 17 models: ResNet18, MobileNetV3, EfficientNet, RegNetY, ConvNeXt, DeiT, LeViT and others, on Imagenette, Imagewoof, EuroSAT and PathMNIST. Segmentation, 6 models: LRASPP, DeepLabV3, a U-Net and an eye segmenter, on Oxford Pets, Pascal VOC and eye images. Object detection, 10 models: SSDlite, YOLOX-Nano, EfficientDet-D0, D-FINE-N and RT-DETR-R18, on COCO and Pascal VOC. The optimiser runs the same four steps for every task: check-up, search, refine, final check. Out come 33 reports, one per model–dataset pair, for example RegNetY on Imagewoof, 3.7 times smaller; the U-Net on Pets, 8.2 times smaller; SSDlite on COCO, 3.3 times smaller. A dashed arrow carries the findings back into the optimiser: 51 lessons from 14 field tests so far.
One procedure for every task, one report per model–dataset pair, and the findings of each run fed back into the optimiser.

The procedure: four steps and a feedback loop

Every pair goes through the same web service a client uses, unattended, in four steps, and a fifth closes the loop:

  1. Check-up: the original model is measured on your held-out images, class by class, and the goal is set.
  2. Search: versions are built and scored on the search images, first from fixed rules, then by a Bayesian search.
  3. Refine: the best versions and the closest misses get their neighbours tried.
  4. Final check: about eight finalists are scored on the held-out images, and the smallest that meets the goal wins.
  5. Feedback: every run doubles as a field test of the optimiser. Whatever broke or underperformed is written down as a lesson and fixed, and the fix is checked on the next run: 51 lessons from 14 field tests so far.

All 33 pairs took 16.5 hours on one server. Detectors are cut before non-maximum suppression, the step that removes duplicate boxes, and the platform applies the same one to every version, as a deployment on an accelerator does.

Optimisation techniques: four, all post-training

Everything is post-training: the weights are changed directly, never retrained, and labels only check quality. Four techniques do the work, from the largest change to the finest; quantisation comes in two forms, FP16 and INT8.

Four rows, each with a before and after drawing. Changes to the structure: smaller input, an 8 by 8 pixel grid becomes 6 by 6, compute falls with the square of the scale, at the cost of fine detail; structured pruning, eight channels become six, less compute, but residual joins block it on most modern networks; low-rank factorisation, a square matrix becomes a tall thin one times a short wide one, fewer weights where layers are large, but it rarely gives more than a polish. Changes to the numbers: quantisation, 32 bits become 16 for FP16, half the size with almost no change, or 8 for INT8, 4 times smaller weights and about 3.5 times smaller models, with the layers INT8 hurts most kept in float.
The four techniques, what each buys and what it costs.

The INT8 scan decides which layers stay in float, hence versions such as “INT8, 1 layer in float”; our quantization post shows what the rounding costs. The output is always standard ONNX, cleaned up by the runtime as in compilation, so vendor toolchains start from a standard format, within their operator support.

How the search chooses

The search works inside the goal set at the check-up: it looks for the smallest version, and discards any version that breaks the goal.

Trying every combination is out of reach. Five input sizes, no pruning or eight levels of it, FP32, FP16 or INT8, and for INT8 three calibrations and up to 15 layers kept in float: 2,250 versions for the U-Net alone, about 17 hours at the half-minute each takes to build and score. The search built 44 of them, in 20 minutes and three steps. No language model is involved: every choice follows from measurements, and with the same inputs, settings and software versions, the search gives the same result.

  1. First tries, from fixed rules. Before the search, a scan measures layer by layer, without labels, how much INT8 and pruning hurt. Fixed rules turn that into the first versions: FP16, plain INT8 with each calibration, INT8 with the most fragile layers kept in float, and a middle pruning level.
  2. Bayesian search, guided by the scores so far. Optuna’s TPE (Tree-structured Parzen Estimator) proposes each next version from how the previous ones scored, steering towards small and accurate. It stops after 40 proposals, or after 12 in a row that find nothing better. A version already built is never built again.
  3. Refine, small changes around the best results. The three best versions and the two closest misses get small tweaks: one layer more or fewer in float, another calibration, a nearby input size. Eleven of the 33 winners came from this step.

Each pair builds at most 54 versions, 40 in the first two steps and 14 in refine; in our run, 27 per model on average. Nothing is retrained: a version is converted, then scored. A quick check without labels drops any version that changes too many of the original’s predictions, and the rest are scored against the goal on the search images. Up to eight finalists, 6 on average, are then compared with the original on the held-out images, and the smallest that meets the goal wins.

Two panels with the same axes: every version the search built, in the order tried, against file size in MB on a log scale, then a final-check column. A, the U-Net on Oxford Pets, 44 versions, original 25.3 MB: six first tries bring the smallest version that met the goal down in steps, FP16 at 12.7 MB, INT8 at 6.8 MB, INT8 with pruning at 4.2 MB; the Bayesian search, 24 versions, adds a smaller input and finds the 3.09 MB winner at version 17; 14 refine versions find nothing smaller. In the final check five of eight finalists pass, and the winner is 8.2 times smaller, mIoU 0.3 points lower. B, ResNet18 on Imagenette, 33 versions, original 44.6 MB: FP16 at 22.3 MB, then INT8 at 11.3 MB; most Bayesian search versions, with pruning or a smaller input, miss the goal, and the search stops early after 13; refine finds a pruned 9.8 MB version. In the final check five of eight finalists fail, the 9.8 MB one and plain INT8 among them; the winner, INT8 with one layer kept in float found by refine, is 3.9 times smaller, accuracy 0.5 points lower.
Each dot is one version, at its file size. The green line is the smallest one so far that met the goal on the search images; the ringed ones went to the final check.

On the U-Net (panel A), the first tries reached 4.2 MB and the Bayesian search 3.1 MB, with a smaller input. On ResNet18 (panel B), pruning and a smaller input broke the model; the winner came from refine, INT8 with one layer in float, 3.9× smaller.

The final check protects the result. With 80 search images, one image is 1.25 percentage points of accuracy, so a version can look better on the search images than it is. Re-checking the finalists on the held-out images changed our pick in 17 of the 33 cases.

Results

All 33 tested models came back smaller, and every score stayed within the goal. Each arrow joins an original model to the version we recommend, both measured on the same held-out images: its length is the size saved, its drop the score lost.

Three panels, one per task, of model size in MB on a log scale against the score on the held-out images. Each original model is a hollow circle, joined by an arrow to a filled circle, the version we recommend; a green pointer in each panel marks the better direction, towards the top left: smaller and more accurate. Every arrow points left and stays almost level. A, classification, 17 models, accuracy on the held-out images: EfficientNet-B0 3.5 times smaller, ResNet18 3.9 times, MobileNetV3 on PathMNIST 3.6 times and up from 84.8 to 86.0 %; a cluster of Imagewoof models between 90 and 94 % moves from 15 to 50 MB down to 4 to 15 MB. B, segmentation, 6 models, mIoU: RITnet 4.2 times smaller, from about 1 MB to 0.23 MB; the U-Net 8.2 times, from 25 to 3 MB, 88.8 to 88.4; DeepLabV3 3.8 times. C, object detection, 10 models, mAP: SSDlite 3.3 times smaller; the others 1.9 to 2.7 times, the transformer detectors D-FINE-N and RT-DETR-R18 about 2 times with no loss.
Hollow circle: the original model; filled circle: the version we recommend. The goal is a long arrow to the left that stays level: a smaller model that keeps its score.

The classification intervals are the widest because each image counts once: with about 420 held-out images, ±1.5 to 2 percentage points of accuracy is as precise as it gets, and a larger validation set narrows it.

Quantisation does most of the work. INT8 won 19 of the 33 cases, at 2.6× to 3.9× smaller, and more where pruning or a smaller input joined it. FP16 won the other 14, at about 2×, where INT8 missed the goal.

Some models refuse INT8, and the report says why. The transformer detectors, D-FINE-N and RT-DETR, miss the goal in INT8 by 1.5 to 3.6 percentage points of mAP: attention and the decoder’s box refinement amplify the rounding error. On VOC, one class of the LRASPP segmenter loses 6 percentage points of IoU in INT8 whatever stays in float. FP16 won in both cases, and 16-bit layers on the board are the next lever.

Without retraining, pruning rarely reaches far. Residual connections tie most modern networks together: on RegNetY it could remove 0.1 % of the compute, and on the transformer detectors and EfficientDet nothing, so it was left out, with the reason. Where it reaches, it pays: 33 % less compute on the U-Net, 58 % on the eye segmenter. Low-rank factorisation, by contrast, never gave more than a polish, 1 % on RT-DETR.

What Kernwerk delivers

For every model you send, we deliver three things, all built from the same measurements:

  • The optimised models, in standard ONNX: the one we recommend and its alternatives, each traced back to its original, its recipe and its file.
  • The Kernwerk report, 4 to 5 pages, for your decision: what we changed, quality per class before and after, every version we tried in one chart, and why we left any technique out.
  • The technical report, for your engineers: every trial, our search’s estimates against the held-out verdict, and a confidence interval on every change.

We check every PDF automatically for text drawn over other text before it leaves us. Yes, we test our own reports.

Next: one board

This generalist mode ranks versions by size and compute, and promises nothing about speed on a given chip. On a real NPU (neural processing unit), the vendor’s toolchain redoes part of the work: it requantises from the float model, sends layers it cannot run back to the CPU, and may want float layers in 16-bit. Our lab showed how much those details move a model.

Next, we run all 33 models on one target board and measure what survives, what falls back and how fast each version really is. The findings become rules the optimiser follows for that board.

Send us a trained model and a few hundred of your validation images. We will tell you how much lighter it gets, what it costs per class, and what we left out and why. Talk to us.