ADR 0054: Multi-Model Abstraction Layer for Plant Classification
Status: accepted Date: 2026-06-17
Context
Current plants worker has one hardcoded PlantNet-300K model (ONNX, ResNet-18, 1,081 species). Users report missing species (rhododendron, many garden plants). Broader pretrained models exist: PlantCLEF 2024 DINOv2 (7,800 species, MIT), iNaturalist ViT-Base (~10,000 species, Apache-2.0). These use HuggingFace Transformers (PyTorch) instead of ONNX Runtime.
Decision
Create BasePlantClassifier abstraction layer with two backends: OnnxClassifier (existing ONNX path) and HfTransformerClassifier (HF Transformers). Model selection via MEMORIES_PLANTS_MODEL env var. Default: plantnet300k (backward compatible). ClassId format: {namespace}_{localId} (e.g. plantnet300k_0000). Each model bundles its own class map. Core API scopes allowed_classes by taxonomy_namespace.
Consequences
Positive: operators can switch to broader models without worker code changes; new models addable at ~5% effort each; existing PlantNet pipeline unchanged. Negative: Docker image grows ~2-3GB (torch CPU + transformers); CPU inference latency increases 10-30x for transformer models (~2-5s/image). Risk: OOM on small hosts — recommend >=4GB RAM for PlantCLEF model.
Memories Wiki
Using Memories
- Accounts, the Library Hub, and Data Export
- Albums and Automatic Suggestions
- Explore and Discovery Domains
- The Media Viewer
- People and Faces
- Places and Map
- Plants (In Development)
- Datenschutzerklärung (Privacy Policy)
- Fast, Progressive Image Loading
- Search
- Sharing and Households
- Timeline and Photos
- Uploading and Import
Self-Hosting
- Backup and Restore
- CLI Password Reset
- Deployment Architecture
- Known Issues and Operator Diagnostics
- Map Tiles and Place Data Privacy
- Storage Layout
- Upgrades and Versioning
- Workers
Reference