EdgeNeXt-S Kenosis: 81.5% ImageNet in 7.0 MB

EdgeNeXt-S (timm/edgenext_small.usi_in1k, MIT) at 320px, made smaller and faster on CPU by Kenosis while keeping accuracy near the original. 81.53% top-1 from a single 6.97 MB standard .onnx file. The same file runs on CPU in both ONNX Runtime and OpenVINO. Calibrated on 128 images, with no retraining.

Accuracy

ImageNet-1K validation, 49,872 images (disjoint from the 128 calibration images), top-1.

model ONNX Runtime OpenVINO size
Original 81.565% 81.565% 22.5 MB
Kenosis 81.535% 81.483% 6.97 MB

Speed

Median time per image over 60 runs, on a CPU with AVX-VNNI.

runtime threads Original Kenosis
ONNX Runtime 1 62.0 ms 47.8 ms
ONNX Runtime 4 27.1 ms 25.0 ms
OpenVINO 1 43.8 ms 26.4 ms
OpenVINO 4 13.5 ms 9.2 ms

Run

from huggingface_hub import hf_hub_download
import numpy as np
import onnxruntime as ort
from PIL import Image

model_path = hf_hub_download("CoreEpoch/edgenext-small-int8-imagenet", "edgenext_s_320_int8_kenosis.onnx")
sess = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
img = Image.open("your_image.jpg").convert("RGB")
scale = 320 / min(img.size)  # shorter side to 320, center crop: measured transform
img = img.resize((round(img.width*scale), round(img.height*scale)), Image.BICUBIC)
l, t = (img.width-320)//2, (img.height-320)//2
img = img.crop((l, t, l+320, t+320))
x = (np.asarray(img, np.float32)/255.0 - [0.485,0.456,0.406]) / [0.229,0.224,0.225]
logits = sess.run(None, {"input": x.transpose(2,0,1)[None].astype(np.float32)})[0]
print(int(np.argmax(logits)))

Input 1x3x320x320, RGB, /255, ImageNet mean/std. Output logits [1,1000], sorted-synset order.

Run this file on a CPU. On OpenVINO's GPU plugin it returns wrong predictions.

Integrity & license

edgenext_s_320_int8_kenosis.onnx (6,967,304 B), SHA-256 3D5DEFD547097630DADEF74E56311BC5CEB4375B8E99C5DD86D06C5435F51D8D. MIT (base EdgeNeXt, Maaz et al. 2022, retained). The license covers these model files only; it grants no rights in Kenosis, Core Epoch's quantizer, which remains proprietary.

Benchmarks and contact: coreepoch.dev/kenosis · contact@coreepoch.dev

Downloads last month
62
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for CoreEpoch/edgenext-small-int8-imagenet

Quantized
(1)
this model

Dataset used to train CoreEpoch/edgenext-small-int8-imagenet