Simat Labs
Book a demo

This research post is available in English only.

Simat Labs engineering team7 min read

PackCount-Simat-8M: Distilling Qwen3-VL-8B to Count Packs Loaded into Trucks, 66× Faster and Just as Accurate

Bar chart of median latency per video window: Qwen3-VL-8B 650 ms, PackCount-Simat-8M 9.85 ms
Photo: Simat Labs · All rights reserved

PackCount-Simat-8M, trained on Qwen3-VL-8B's answers, counts packs loaded into a truck as accurately as the 8B model, in 10 ms per window instead of 650 ms.

Why we ran this

Large vision-language models can answer almost any question about a video, but they are slow and expensive to run on every camera all day. Distillation is the standard way round that: let the large model (the teacher) label footage, then train a small model (the student) to give the same answers for one task.

We wanted our own measurement of how much speed this buys and how much accuracy it costs, on a task we already deploy.

The task and the data

The task is counting the packs (cartons and wrapped bundles) loaded into a truck through one dock door at a customer's loading dock, filmed by one fixed overhead camera. A pack counts when it passes through the doorway, and packs going in are counted separately from packs coming back out. We used three recorded sessions of eight to ten minutes each. Two of them have hand counts, of 57 and 87 packs. The third has none.

Each session is cut into 2-second windows of 20 frames, cropped to the doorway. A model sees one window and answers how many packs went into the truck during it, from 0 to 3. The footage stayed on GPU servers we rented in EU data centres and was not sent to any hosted model API.

How we scored it

Every system is scored the same way against the hand counts. A predicted pack is a hit if it falls within 3 seconds of a hand-counted pack going in the same direction, and each hand-counted pack can be matched once. Accuracy is hits divided by the hand-counted packs plus the extra counts, so missed packs and invented packs both lower it.

The student is always tested on a hand-counted session it never trained on. Each result is reported for three training runs with different random seeds.

The teacher: Qwen3-VL-8B

We ran Qwen3-VL-8B at full precision on one A100 and asked it, for each window, how many packs went in and how many came out. Over both hand-counted sessions it hit 134 of 144 packs, missed 10 and invented 41, which is 72% accuracy. It scored 84% on one session and 66% on the other, where most of the invented counts were. Its median latency was 650 ms per window.

The student: PackCount-Simat-8M

The student, which we named PackCount-Simat-8M, is a compact video network with 7.9 million parameters. We trained it on the teacher's answers for one hand-counted session plus the unlabelled session and tested it on the other hand-counted session. Then we swapped the two hand-counted sessions and repeated. It counts packs going into the truck only, and answers 0, 1, 2 or 3 for each window.

Results

These figures come from the held-out session in each direction. The latency figures exclude video decoding and resizing for both models. The student ran without any inference optimization, so 9.85 ms is not its floor.

  • Accuracy on the 57-pack session: student 79% to 83% across three seeds, Qwen3-VL-8B 84%.
  • Accuracy on the 87-pack session: student 78% to 81%, Qwen3-VL-8B 66%. The student did not copy most of the teacher's invented counts.
  • Both sessions together: student 79.0% to 80.6%, Qwen3-VL-8B 72.4%.
  • Median latency per window, batch 1, one A100: student 9.85 ms, Qwen3-VL-8B 650 ms. That is 66× faster.
  • The student misses more packs than the teacher (it finds 84% to 88% of them against the teacher's 93%) and invents far fewer.
Accuracy against hand counts50%60%70%80%90%10 ms100 ms1 sMedian time per 2-second video window, one A100 (log scale)Production pack counter: 88.7% accuracy on the same two sessionsProduction counter, 89% (time not measured on this hardware)66× fasterPackCount-Simat-8M: 80.0% accuracy (79.0% to 80.6% over three training runs), 9.85 msPackCount-Simat-8M80% · 9.85 msQwen3-VL-8B: 72.4% accuracy, 650 msQwen3-VL-8B72% · 650 msQwen3-VL-32B: 64.2% accuracy, 2.09 sQwen3-VL-32B64% · 2.09 sQwen3-VL-32B, 4-bit: 56.3% accuracy, 2.16 sQwen3-VL-32B, 4-bit56% · 2.16 s
Speed against accuracy on the pack-counting task. Further left is faster and higher is more accurate. The whisker on PackCount-Simat-8M spans its three training runs.

Two ways to be wrong

A counter can be wrong in two ways: it can miss a pack, or it can count one that was not there. The chart below separates the two. The Qwen models sit on the left. They find almost every pack and invent many. PackCount-Simat-8M sits on the right. It invents few and misses more.

The dashed lines join points with the same accuracy, so a model improves by moving up or to the right across them. Our production counter is in the top right corner, which is where the next version of the distilled model needs to get to.

Recall: share of the packs it found80%85%90%95%100%60%70%80%90%100%Precision: share of its counts that were real packs60% accuracy70% accuracy80% accuracy90% accuracyinvents many countsinvents few, misses moreQwen3-VL-32B: found 97.2% of packs, 65.4% of its counts were real, 64.2% accuracyQwen3-VL-32BQwen3-VL-32B, 4-bit: found 89.6% of packs, 60.3% of its counts were real, 56.3% accuracyQwen3-VL-32B, 4-bitQwen3-VL-8B: found 93.1% of packs, 76.6% of its counts were real, 72.4% accuracyQwen3-VL-8BProduction pack counter: found 93.1% of packs, 95.0% of its counts were real, 88.7% accuracyProduction counterPackCount-Simat-8M, one training run: found 85.4% of packs, 93.2% of its counts were realPackCount-Simat-8M, one training run: found 86.1% of packs, 90.5% of its counts were realPackCount-Simat-8M, one training run: found 86.8% of packs, 91.9% of its counts were realPackCount-Simat-8Mthree training runs
Share of packs found against share of counts that were real, both sessions together. Dashed lines are equal accuracy. Each blue dot is one training run of PackCount-Simat-8M.

What made it work: more footage, not better labels

With only one session of training data the student failed, whichever labels it used. Trained on one session of teacher labels it scored 10% to 14% on one test session and 54% to 64% on the other. Trained on one session of hand counts it swung from 25% to 77% depending on the seed.

Adding the unlabelled session, which the teacher labelled at no extra cost, is what made the result stable. That is the practical value of the large model here: it turns unlabelled footage into training data.

Training loss, six runs of PackCount-Simat-8M (log scale)0.010.11start of trainingend of trainingTraining run 1: loss 1.371 at the start, 0.009 at the endTraining run 2: loss 1.358 at the start, 0.015 at the endTraining run 3: loss 1.208 at the start, 0.011 at the endTraining run 4: loss 1.355 at the start, 0.013 at the endTraining run 5: loss 1.42 at the start, 0.011 at the endTraining run 6: loss 1.253 at the start, 0.015 at the endAccuracy on the held-out session, by training settested on the 57-pack sessiontested on the 87-pack session0%25%50%75%100%Qwen3-VL-8B itself: 72.4% accuracy over both sessionsQwen3-VL-8B itself, 72%Qwen3-VL-8B labels, two sessionsPackCount-Simat-8MQwen3-VL-8B labels, two sessions, tested on the 57-pack session: 83.3%Qwen3-VL-8B labels, two sessions, tested on the 57-pack session: 79%Qwen3-VL-8B labels, two sessions, tested on the 57-pack session: 80.3%Qwen3-VL-8B labels, two sessions, tested on the 87-pack session: 78.5%Qwen3-VL-8B labels, two sessions, tested on the 87-pack session: 78.9%Qwen3-VL-8B labels, two sessions, tested on the 87-pack session: 80.9%Qwen3-VL-8B labels, one sessionhalf the footageQwen3-VL-8B labels, one session, tested on the 57-pack session: 13.6%Qwen3-VL-8B labels, one session, tested on the 57-pack session: 9.5%Qwen3-VL-8B labels, one session, tested on the 57-pack session: 10.5%Qwen3-VL-8B labels, one session, tested on the 87-pack session: 62.2%Qwen3-VL-8B labels, one session, tested on the 87-pack session: 63.9%Qwen3-VL-8B labels, one session, tested on the 87-pack session: 53.8%Hand counts, one sessionhalf the footageHand counts, one session, tested on the 57-pack session: 39.7%Hand counts, one session, tested on the 57-pack session: 67.5%Hand counts, one session, tested on the 57-pack session: 77%Hand counts, one session, tested on the 87-pack session: 50.5%Hand counts, one session, tested on the 87-pack session: 24.8%Hand counts, one session, tested on the 87-pack session: 48.9%
Top: training loss for the six runs of PackCount-Simat-8M. Bottom: accuracy on the session each run never saw, three runs per test session. Only the two-session training set gives the same answer every time.

The 4-bit quantization test

Separately, we compared Qwen3-VL-32B at full precision with a publicly available 4-bit build of the same model, both on one A100.

  • Text generation (256 output tokens per request): 4-bit was 160% faster at one request at a time, 125% faster at 4 and 54% faster at 16.
  • Pack counting: no faster. 2.09 s per window at full precision and 2.16 s at 4-bit, with 3% to 21% fewer windows per second under load.
  • Counting accuracy fell from 64% to 56%.
  • GPU memory fell from 71.9 GB to 28.2 GB.
Qwen3-VL-32B, full precisionQwen3-VL-32B, 4-bitWriting texttokens per second01002003004001416requests at onceFull precision, 1 at once: 22.1 tokens per second4-bit, 1 at once: 57.4 tokens per second (+160%)+160%Full precision, 4 at once: 79.7 tokens per second4-bit, 4 at once: 179.6 tokens per second (+125%)+125%Full precision, 16 at once: 244 tokens per second4-bit, 16 at once: 375.7 tokens per second (+54%)+54%Counting packsvideo windows per second00.20.40.60.81416requests at onceFull precision, 1 at once: 0.477 video windows per second4-bit, 1 at once: 0.465 video windows per second (−3%)−3%Full precision, 4 at once: 0.643 video windows per second4-bit, 4 at once: 0.52 video windows per second (−19%)−19%Full precision, 16 at once: 0.662 video windows per second4-bit, 16 at once: 0.524 video windows per second (−21%)−21%
Qwen3-VL-32B at full precision and at 4-bit. The percentages are the change from full precision. Each panel has its own scale.

Why 4-bit did not help counting

Pack counting spends its time reading: 20 frames come to about 4,100 input tokens, and the answer is about 13 tokens. In our runs the 4-bit weights sped up writing the answer, not reading the frames, so the gain did not reach this task.

The 32B model was also no better than the 8B model at counting. It missed fewer packs, invented many more, and took about three times as long per window.

What this does not show

The result is narrow, and these are its limits:

  • The sample is small: two test sessions of 57 and 87 packs. Differences of a few points are noise.
  • One site, one camera, one gate. We have no evidence yet for other gates or lighting.
  • Our production pack counter scored 85% and 91% on the same two sessions. PackCount-Simat-8M is faster than Qwen3-VL-8B. It is not better than what we deploy.
  • We tested one publicly available 4-bit build. Another quantization could score differently.
  • The teacher's prompt was written once and not tuned. A better prompt could change the teacher's invented counts, and with them the student.

What comes next

Next we will hand-count the third session, so teacher labels and hand labels can be compared on equal amounts of data. We will also train on more footage and measure the student again after inference optimization.

Related on simatlabs.com

Have a problem a camera could solve?

Describe it, add a photo, and get a free first read on whether AI vision can handle it.

Run the feasibility check

More posts

Last updated: