Image classification
YOLO26n-cls
Ultralytics' smallest YOLO26 classifier: names the main subject of a photo among 1,000 categories.
About this model
YOLO26n-cls is the nano classification model of Ultralytics' YOLO26 family. It names the main subject of a photo among the 1,000 ImageNet categories with only 2.8 million parameters, about 1 ms per photo on Apple's Neural Engine.
Ultralytics reports 71.4% top-1 accuracy on ImageNet. Larger sizes (s, m, l, x) trade speed for accuracy and convert the same way.
What you can build
- Classification in apps already built around Ultralytics YOLO
- The smallest download in this group (4 to 6 MB)
Golden retriever dog
f16Karen Arnold, CC0, https://commons.wikimedia.org/wiki/File:Golden-retriever-dog-1362597631o6g.jpg
Top 5 on the Apple Neural Engine (FP16 pack): golden_retriever: 99.3% Labrador_retriever: 0.4% tennis_ball: 0.1% cocker_spaniel: 0.1% otterhound: 0.0%
Macaw parrot
f16Christopher Kuszajewski, CC0, https://commons.wikimedia.org/wiki/File:Macaw_parrot_sitting_on_a_tree_branch.jpg_.jpg
Top 5 on the Apple Neural Engine (FP16 pack): macaw: 100.0% toucan: 0.0% lorikeet: 0.0% sulphur-crested_cockatoo: 0.0% hornbill: 0.0%
Steam locomotive
f16Karora, Public domain, https://commons.wikimedia.org/wiki/File:JA1271_crossing_the_Otaki_River.jpg
Top 5 on the Apple Neural Engine (FP16 pack): monastery: 22.8% palace: 15.4% castle: 9.6% viaduct: 6.2% suspension_bridge: 5.4%
Variants & downloads
Choose the build for your appModel files are hosted on Google Drive. Large files may open a confirmation page before downloading.
Small
SlabWeights stored as int8 in blocks of 64: about a quarter of FP32. Slab decodes them to float when loading, so it runs at the same speed; accuracy is measured below.
Platforms: macos · android
yolo26n-cls-int8.slab
4.1 MB · Hosted download
SHA-256 checksum
104961099c67dbd588aacda8848d7005cb36a75ae43d823c6070628f3c371c17LICENSE-Ultralytics-AGPL-3.0.txt
34 KB
SHA-256 checksum
bf658e13892eedc498ae1ed0b090c0e1e27fd164889354c44c0c54e62e1ff9d2Conversion details
- command
- python -c "import ultralytics; ultralytics.YOLO('yolo26n-cls.pt').export(format='onnx', imgsz=224, opset=17, simplify=False)" && mv yolo26n-cls.onnx model.onnx # Ultralytics writes the export date into the model; a rebuilt pack differs from this one only in its date entry python -c "import ultralytics; n = ultralytics.YOLO('yolo26n-cls.pt').names; open('labels.txt', 'w').write('\n'.join(n[k] for k in range(len(n))) + '\n')" slab-load convert model.onnx model.slab --input images=1x3x224x224 --meta task=classify --meta resize=center_crop --meta resize_size:i64=224 --meta interpolation=bilinear --meta antialias:bool=true --meta normalize=scale255 --meta color=rgb --meta labels:labels=@labels.txt slab-load quantize model.slab yolo26n-cls-int8.slab slab-load meta set yolo26n-cls-int8.slab default_backend.macos=npu slab-load meta set yolo26n-cls-int8.slab scores=probabilities
Integration examples
Python
python
import slab
cfg = slab.Config(cache_dir="/tmp/slab_cache", license=open("license.slablic.txt").read())
session = slab.Session(cfg, "yolo26n-cls-f16.slab", warmup=True)
out = session.run(slab.Input(frame=slab.Frame.open("photo.jpg")))
for c in out.top_k(5):
print(f"{c.label}: {c.score:.1%}")
Device & backend compatibility
Pack default: macos / NPU. Fastest on the Mac (about 1 to 2 ms per photo) and quick to prepare.
| Platform | Engine | Status | Precision |
|---|---|---|---|
| apple | CPU CPU | Supported Measured on macOS. | f32 |
| apple | Metal GPU | Supported Measured on macOS. | f32 |
| apple | Apple Neural Engine NPU | Supported Measured on macOS. The Neural Engine computes in FP16; preparing the model for it takes noticeably longer than for the GPU (see open time under Performance). | f16 |
| android | CPU CPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. | f32 |
| android | Vulkan GPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. | f32 |
| android | Qualcomm Hexagon NPU (QNN) NPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. The NPU computes in FP16 (the int8 pack's weights are widened to FP16). | f16 |
Performance
Results depend on the device, runtime, and test conditions. Each measurement keeps its own context.
Mac with Apple M1 Max
Slab · CPU
macOS 26.6.2
3.5 ms
Measured time · scope below
Median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, preprocessing included: 4.30 ms median. open_ms: opening the session, including preparing the model for the CPU.
Mac with Apple M1 Max
Slab · GPU
macOS 26.6.2
2.3 ms
Measured time · scope below
Median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, preprocessing included: 3.16 ms median. open_ms: opening the session, including preparing the model for the Metal.
Mac with Apple M1 Max
Slab · NPU
macOS 26.6.2
1.1 ms
Measured time · scope below
Median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, preprocessing included: 1.79 ms median. open_ms: opening the session, including preparing the model for the Apple Neural Engine.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · CPU
Android 17
8.5 ms
Measured time · scope below
Median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, preprocessing included: 11.2 ms median. open_ms: opening the session. Peak memory (resident) after the runs: 64 MB.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · GPU
Android 17
8.6 ms
Measured time · scope below
Median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, preprocessing included: 20.5 ms median. open_ms: opening the session with the GPU programs already in the cache folder (the first open on a device compiles them, about 0.3 s more). Peak memory (resident) after the runs: 80 MB.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · NPU
Android 17
1.1 ms
Measured time · scope below
Median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, preprocessing on the CPU included: 8.03 ms median. open_ms: opening the session, including preparing the model for the Hexagon NPU. Peak memory (resident) after the runs: 75 MB.
Accuracy checks
macos · CPU · int8
The upstream PyTorch model with its own preprocessing, on 53 public-domain photos (Wikimedia Commons)
Same top answer on 50/53 photos with Slab doing the preprocessing; on identical input tensors, same top answer on 50/53, upstream's answer among Slab's top 5 on 53/53, largest probability difference 0.086.
macos · GPU · int8
The upstream PyTorch model with its own preprocessing, on 53 public-domain photos (Wikimedia Commons)
Same top answer on 50/53 photos with Slab doing the preprocessing; on identical input tensors, same top answer on 50/53, upstream's answer among Slab's top 5 on 53/53, largest probability difference 0.086.
macos · NPU · int8
The upstream PyTorch model with its own preprocessing, on 53 public-domain photos (Wikimedia Commons)
Same top answer on 49/53 photos with Slab doing the preprocessing; on identical input tensors, same top answer on 49/53, upstream's answer among Slab's top 5 on 53/53, largest probability difference 0.082.
android · NPU · int8
Slab's CPU engine (FP32) on the same 1920 x 1080 photo
Cosine similarity of the output with the CPU's: 0.99994; the same top answer and the same top 5.
Before you choose this model
- Lowest accuracy of this group; it misses harder photos (the steam train below).
- Most sensitive to the int8 pack: 50 of 53 test photos keep the same top answer, against 52 or 53 for the others.
- AGPL-3.0: see License.