From 5b6f74ada29a6cd4a9262b510b851d16e6390956 Mon Sep 17 00:00:00 2001 From: Nikunj Kotecha Date: Tue, 21 Apr 2026 01:41:40 -0700 Subject: [PATCH 1/5] feat(vision): add MobileNetV2 0.5 trained on Plant Village - Add float and 8w8a8 QAT Keras checkpoints under vision/classification/mobilenetv2/plant_village/ (tracked via Git LFS). - Add model README with environment pins and a load+convert-to-Akida snippet taken from the reference notebook. - Add Plant Village row to the top-level model table. --- README.md | 1 + .../mobilenetv2/plant_village/README.md | 72 +++++++++++++++++++ .../mobilenet_v2_0.5_plant_village.h5 | 3 + ...mobilenet_v2_0.5_plant_village_i8_w8_a8.h5 | 3 + 4 files changed, 79 insertions(+) create mode 100644 vision/classification/mobilenetv2/plant_village/README.md create mode 100644 vision/classification/mobilenetv2/plant_village/mobilenet_v2_0.5_plant_village.h5 create mode 100644 vision/classification/mobilenetv2/plant_village/mobilenet_v2_0.5_plant_village_i8_w8_a8.h5 diff --git a/README.md b/README.md index 4a70ebb..2bb251f 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ In addition, some models can be evaluated directly through [Akida Cloud](https:/ | Vision | Classification | [MobileNetV2 1.0](vision/classification/mobilenetv2/imagenet) | 224 | ImageNet | 3.5M | 8 | 70.35% | | | 7 | | Vision | Classification | [MobileNetV2 0.75](vision/classification/mobilenetv2/imagenet) | 160 | ImageNet | 2.6M | 8 | 62.85% | | | 4 ☁️ | | Vision | Classification | [MobileNetV2 0.35](vision/classification/mobilenetv2/imagenet) | 96 | ImageNet | 1.2M | 8 | 43.47% | | | 2 ☁️ | +| Vision | Classification | [MobileNetV2 0.5](vision/classification/mobilenetv2/plant_village) | 224 | Plant Village | 0.7M | 8 | 99.12% | | | 6 | | Vision | Classification | [MobileNetV4 1.0](vision/classification/mobilenetv4/imagenet) | 224 | ImageNet | 3.77M | 8 | 71.86% | | | 8 | | Vision | Classification | [MobileNetV2_1.0](vision/classification/mobilenetv2/cifar10) | 128 | CIFAR-10 | 2.25M | 8 | 93.96% | | | 5 ☁️ | | Vision | Classification | [MobileNetV2_1.0](vision/classification/mobilenetv2/oxford_flowers) | 224 | Oxford_Flower | 2.4M | 8 | 91.97% | | | 7 | diff --git a/vision/classification/mobilenetv2/plant_village/README.md b/vision/classification/mobilenetv2/plant_village/README.md new file mode 100644 index 0000000..fdd42d3 --- /dev/null +++ b/vision/classification/mobilenetv2/plant_village/README.md @@ -0,0 +1,72 @@ +# MobileNetV2 0.5 — Plant Village + +## Source +- **Backbone**: [MobileNetV2](https://www.tensorflow.org/api_docs/python/tf/keras/applications/MobileNetV2) (tf.keras), ImageNet pretrained +- **Alpha**: `MBV2_ALPHA = 0.5` +- **Input resolution**: 224 × 224 × 3 +- **Classes**: 38 (Plant Village) +- **Quantization**: 8-bit weights / 8-bit activations (QAT, `_i8_w8_a8.h5`) + +## Performance + +| Variant | Top-1 accuracy | +|-----------------------|----------------| +| Float | 99.47% | +| Quantized 8w8a8 (QAT) | 99.12% | + +Quantized-model sparsity — ReLU: 89%, overall: 53%. + +## Environment + +Install the exact versions used to export and convert these checkpoints — older +or newer versions may fail to round-trip the `quantizeml` custom layers or produce +a different Akida layer graph: + +```bash +pip install \ + akida==2.17.0 \ + cnn2snn==2.17.0 \ + quantizeml==1.0.1 +``` + +## Files + +- `mobilenet_v2_0.5_plant_village.h5` — float Keras model +- `mobilenet_v2_0.5_plant_village_i8_w8_a8.h5` — QAT 8w8a8 Keras model + +## Load the quantized model and convert to Akida + +```python +from pathlib import Path +import quantizeml +from cnn2snn import convert, set_akida_version, AkidaVersion + +MODEL_PATH = Path("mobilenet_v2_0.5_plant_village_i8_w8_a8.h5") + +keras_model = quantizeml.load_model(str(MODEL_PATH)) + +with set_akida_version(AkidaVersion.v2): + akida_model = convert(keras_model) + +akida_model.summary() +# Input shape: [224, 224, 3] +# Output shape: [1, 1, 38] +``` + +## Map on device (optional) + +```python +import akida + +device = akida.SixNodesIPv2() # or akida.devices()[0] for an Akida 2.0 FPGA +akida_model.map(device, hw_only=True) +akida_model.summary() +``` + +## References +- MobileNetV2 — [Inverted Residuals and Linear Bottlenecks](https://arxiv.org/abs/1801.04381) +- Dataset — [PlantVillage](https://www.kaggle.com/datasets/abdallahalidev/plantvillage-dataset) +- TensorFlow [MobileNetV2 docs](https://www.tensorflow.org/api_docs/python/tf/keras/applications/MobileNetV2) + +## License +Apache 2.0 License (models only) diff --git a/vision/classification/mobilenetv2/plant_village/mobilenet_v2_0.5_plant_village.h5 b/vision/classification/mobilenetv2/plant_village/mobilenet_v2_0.5_plant_village.h5 new file mode 100644 index 0000000..88e4d68 --- /dev/null +++ b/vision/classification/mobilenetv2/plant_village/mobilenet_v2_0.5_plant_village.h5 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05757210d78957cc96cb6bb981fc655d62de227832b883a5527c85d3ea7ee46e +size 3510320 diff --git a/vision/classification/mobilenetv2/plant_village/mobilenet_v2_0.5_plant_village_i8_w8_a8.h5 b/vision/classification/mobilenetv2/plant_village/mobilenet_v2_0.5_plant_village_i8_w8_a8.h5 new file mode 100644 index 0000000..e3a0609 --- /dev/null +++ b/vision/classification/mobilenetv2/plant_village/mobilenet_v2_0.5_plant_village_i8_w8_a8.h5 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41b6b107772f453f3637653b25b523ef84da81db349c3a2c06f6dadab843ea5d +size 3430208 From 4441878ce1eac15ba966a6fcbfc2838817c89f0b Mon Sep 17 00:00:00 2001 From: Kurt Manninen Date: Tue, 21 Apr 2026 15:15:31 -0700 Subject: [PATCH 2/5] Apply suggestion from @kmanninen --- vision/classification/mobilenetv2/plant_village/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/vision/classification/mobilenetv2/plant_village/README.md b/vision/classification/mobilenetv2/plant_village/README.md index fdd42d3..29a5c05 100644 --- a/vision/classification/mobilenetv2/plant_village/README.md +++ b/vision/classification/mobilenetv2/plant_village/README.md @@ -37,7 +37,6 @@ pip install \ ## Load the quantized model and convert to Akida ```python -from pathlib import Path import quantizeml from cnn2snn import convert, set_akida_version, AkidaVersion From 6ae4da3e7966c398b0318712331a74c64f407528 Mon Sep 17 00:00:00 2001 From: Kurt Manninen Date: Tue, 21 Apr 2026 15:15:48 -0700 Subject: [PATCH 3/5] Apply suggestion from @ktsiknos-brainchip Co-authored-by: Kevin Tsiknos <60514526+ktsiknos-brainchip@users.noreply.github.com> --- vision/classification/mobilenetv2/plant_village/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vision/classification/mobilenetv2/plant_village/README.md b/vision/classification/mobilenetv2/plant_village/README.md index 29a5c05..cae4c63 100644 --- a/vision/classification/mobilenetv2/plant_village/README.md +++ b/vision/classification/mobilenetv2/plant_village/README.md @@ -40,9 +40,7 @@ pip install \ import quantizeml from cnn2snn import convert, set_akida_version, AkidaVersion -MODEL_PATH = Path("mobilenet_v2_0.5_plant_village_i8_w8_a8.h5") - -keras_model = quantizeml.load_model(str(MODEL_PATH)) +keras_model = quantizeml.load_model("mobilenet_v2_0.5_plant_village_i8_w8_a8.h5") with set_akida_version(AkidaVersion.v2): akida_model = convert(keras_model) From cb080f6b01ec4ac888cca450980f94ebe240da8b Mon Sep 17 00:00:00 2001 From: Kurt Manninen Date: Tue, 21 Apr 2026 15:16:39 -0700 Subject: [PATCH 4/5] Apply suggestion from @kmanninen --- vision/classification/mobilenetv2/plant_village/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vision/classification/mobilenetv2/plant_village/README.md b/vision/classification/mobilenetv2/plant_village/README.md index cae4c63..7675051 100644 --- a/vision/classification/mobilenetv2/plant_village/README.md +++ b/vision/classification/mobilenetv2/plant_village/README.md @@ -62,7 +62,7 @@ akida_model.summary() ## References - MobileNetV2 — [Inverted Residuals and Linear Bottlenecks](https://arxiv.org/abs/1801.04381) -- Dataset — [PlantVillage](https://www.kaggle.com/datasets/abdallahalidev/plantvillage-dataset) +- Dataset — [PlantVillage](https://www.tensorflow.org/datasets/catalog/plant_village) - TensorFlow [MobileNetV2 docs](https://www.tensorflow.org/api_docs/python/tf/keras/applications/MobileNetV2) ## License From bcb9210e67c08db9b6e4ac23036006e84e600480 Mon Sep 17 00:00:00 2001 From: Kurt Manninen Date: Tue, 21 Apr 2026 15:21:28 -0700 Subject: [PATCH 5/5] Apply suggestion from @kmanninen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bb251f..b4e36d5 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ In addition, some models can be evaluated directly through [Akida Cloud](https:/ | Vision | Classification | [MobileNetV2 1.0](vision/classification/mobilenetv2/imagenet) | 224 | ImageNet | 3.5M | 8 | 70.35% | | | 7 | | Vision | Classification | [MobileNetV2 0.75](vision/classification/mobilenetv2/imagenet) | 160 | ImageNet | 2.6M | 8 | 62.85% | | | 4 ☁️ | | Vision | Classification | [MobileNetV2 0.35](vision/classification/mobilenetv2/imagenet) | 96 | ImageNet | 1.2M | 8 | 43.47% | | | 2 ☁️ | -| Vision | Classification | [MobileNetV2 0.5](vision/classification/mobilenetv2/plant_village) | 224 | Plant Village | 0.7M | 8 | 99.12% | | | 6 | +| Vision | Classification | [MobileNetV2 0.5](vision/classification/mobilenetv2/plant_village) | 224 | Plant Village | 0.7M | 8 | 99.12% | | | 4 | | Vision | Classification | [MobileNetV4 1.0](vision/classification/mobilenetv4/imagenet) | 224 | ImageNet | 3.77M | 8 | 71.86% | | | 8 | | Vision | Classification | [MobileNetV2_1.0](vision/classification/mobilenetv2/cifar10) | 128 | CIFAR-10 | 2.25M | 8 | 93.96% | | | 5 ☁️ | | Vision | Classification | [MobileNetV2_1.0](vision/classification/mobilenetv2/oxford_flowers) | 224 | Oxford_Flower | 2.4M | 8 | 91.97% | | | 7 |