I created KopiMap (https://kopimap.com) to help people discover great cafés in Jakarta Indonesia, but I wanted to take the UX further by automatically organizing user-submitted photos into meaningful categories (menu, food/drinks, ambiance).
The challenge is how to classify images as cost efficient as possible without compromising performance. I decided to go with running ML models on the client-side.
Technical implementation:
- Built and trained a compact TensorflowJS model (~3MB) that runs entirely in-browser
- Model lazy loads only when users are submitting reviews
- Classifies uploaded photos into Menu, Food & Drink, or Vibes (interior/exterior)
- Zero server costs for inference, quick enough classification feedback
This approached solved several problems:
1. Reduced server costs by moving inference to the client
2. Improved UX with immediate photo categorization
3. Maintained app performance by lazy loading the model
Would love feedback from the HN community on:
- Optimizing the model size further
- Alternative approaches to client-side ML
- General UX improvements for local discovery apps
I had no prior ML experience, so this was a fun challenge :)
The challenge is how to classify images as cost efficient as possible without compromising performance. I decided to go with running ML models on the client-side.
Technical implementation: - Built and trained a compact TensorflowJS model (~3MB) that runs entirely in-browser - Model lazy loads only when users are submitting reviews - Classifies uploaded photos into Menu, Food & Drink, or Vibes (interior/exterior) - Zero server costs for inference, quick enough classification feedback
This approached solved several problems: 1. Reduced server costs by moving inference to the client 2. Improved UX with immediate photo categorization 3. Maintained app performance by lazy loading the model
Would love feedback from the HN community on: - Optimizing the model size further - Alternative approaches to client-side ML - General UX improvements for local discovery apps
I had no prior ML experience, so this was a fun challenge :)