AlexNet
Model | Download | Download (with sample test data) | ONNX version | Opset version | Top-1 accuracy (%) | Top-5 accuracy (%) |
---|---|---|---|---|---|---|
AlexNet | 238 MB | 225 MB | 1.1 | 3 | ||
AlexNet | 238 MB | 225 MB | 1.1.2 | 6 | ||
AlexNet | 238 MB | 226 MB | 1.2 | 7 | ||
AlexNet | 238 MB | 226 MB | 1.3 | 8 | ||
AlexNet | 238 MB | 226 MB | 1.4 | 9 | ||
AlexNet | 233 MB | 216 MB | 1.9 | 12 | 54.80 | 78.23 |
AlexNet-int8 | 58 MB | 39 MB | 1.9 | 12 | 54.68 | 78.23 |
AlexNet-qdq | 59 MB | 44 MB | 1.9 | 12 | 54.71 | 78.22 |
Compared with the fp32 AlextNet, int8 AlextNet's Top-1 accuracy drop ratio is 0.22%, Top-5 accuracy drop ratio is 0.05% and performance improvement is 2.26x.
Note
Different preprocess methods will lead to different accuracies, the accuracy in table depends on this specific preprocess method.
The performance depends on the test hardware. Performance data here is collected with Intel® Xeon® Platinum 8280 Processor, 1s 4c per instance, CentOS Linux 8.3, data batch size is 1.
Description
AlexNet is the name of a convolutional neural network for classification, which competed in the ImageNet Large Scale Visual Recognition Challenge in 2012.
Differences:
- not training with the relighting data-augmentation;
- initializing non-zero biases to 0.1 instead of 1 (found necessary for training, as initialization to 1 gave flat loss).
Dataset
Source
Caffe BVLC AlexNet ==> Caffe2 AlexNet ==> ONNX AlexNet
Model input and output
Input
data_0: float[1, 3, 224, 224]
Output
softmaxout_1: float[1, 1000]
Pre-processing steps
Post-processing steps
Sample test data
Randomly generated sample test data:
- test_data_0.npz
- test_data_1.npz
- test_data_2.npz
- test_data_set_0
- test_data_set_1
- test_data_set_2
Results/accuracy on test set
The bundled model is the iteration 360,000 snapshot. The best validation performance during training was iteration 358,000 with validation accuracy 57.258% and loss 1.83948. This model obtains a top-1 accuracy 57.1% and a top-5 accuracy 80.2% on the validation set, using just the center crop. (Using the average of 10 crops, (4 + 1 center) * 2 mirror, should obtain a bit higher accuracy.)
Quantization
AlexNet-int8 and AlexNet-qdq are obtained by quantizing fp32 AlexNet model. We use Intel® Neural Compressor with onnxruntime backend to perform quantization. View the instructions to understand how to use Intel® Neural Compressor for quantization.
Environment
onnx: 1.9.0 onnxruntime: 1.8.0
Prepare model
wget https://github.com/onnx/models/raw/main/vision/classification/alexnet/model/bvlcalexnet-12.onnx
Model quantize
Make sure to specify the appropriate dataset path in the configuration file.
bash run_tuning.sh --input_model=path/to/model \ # model path as *.onnx
--config=alexnet.yaml \
--data_path=/path/to/imagenet \
--label_path=/path/to/imagenet/label \
--output_model=path/to/save
References
Contributors
- mengniwang95 (Intel)
- yuwenzho (Intel)
- airMeng (Intel)
- ftian1 (Intel)
- hshen14 (Intel)