Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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% | | | 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 |
Expand Down
69 changes: 69 additions & 0 deletions vision/classification/mobilenetv2/plant_village/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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
Comment thread
kmanninen marked this conversation as resolved.
```

## 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
import quantizeml
from cnn2snn import convert, set_akida_version, AkidaVersion

keras_model = quantizeml.load_model("mobilenet_v2_0.5_plant_village_i8_w8_a8.h5")

with set_akida_version(AkidaVersion.v2):
Comment thread
kmanninen marked this conversation as resolved.
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.tensorflow.org/datasets/catalog/plant_village)
- TensorFlow [MobileNetV2 docs](https://www.tensorflow.org/api_docs/python/tf/keras/applications/MobileNetV2)

## License
Apache 2.0 License (models only)
Git LFS file not shown
Git LFS file not shown
Loading