Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for Banana Sensei
What it does
Banana Sensei is a tiny web app that looks at a photo of a banana and tells you how ripe it is — and what to make with it. Upload a photo (or drag and drop), and a zero-shot image classifier running entirely in your browser sorts it into:
- Unripe (green) — better for cooking, chips, or a few more days on the counter
- Perfectly ripe (yellow) — eat it now, or smoothie it
- Very ripe (brown spots) — banana bread and cake time — the sweetest stage!
- Past its prime — check before eating
Every verdict comes with kitchen advice from the teacher.
Inspiration
Bananas are one of the most-wasted fruits in a typical kitchen — people bin them exactly when they are at peak sweetness, or eat them green and chalky. I wanted a two-second check that makes the right decision obvious.
How I built it
The whole app is a single HTML file. It uses CLIP (Xenova/clip-vit-base-patch32) via Transformers.js, loaded from a CDN, running 100% client-side — the photo never leaves the device (it is processed via an in-memory blob URL; nothing is uploaded anywhere).
CLIP is zero-shot: instead of training a classifier, the app compares the photo against text descriptions ("a photo of a clean yellow banana", "a photo of an old banana with brown spots", ...) and picks the best match. No training data needed.
I tuned the prompts by testing real banana photos (green, ripe, overripe, spoiled) against several prompt configurations and picked the wording with the best measured accuracy.
Challenges I faced
- Zero-shot ripeness is subtle: "yellow with a few spots" vs "old and brown" is a fine line for CLIP. Early prompt sets confused clean yellow bananas with overripe ones. I ran an actual test matrix (7 photos x 6 prompt configs) and selected the final wording from the measurements.
- Model download: the ~90 MB CLIP model is cached by the browser after the first load; I added a progress bar so the wait is visible.
What I learned
- Prompt engineering for zero-shot vision is measurable — you can iterate against a fixed test set like any ML workflow.
- Transformers.js makes genuinely useful on-device AI a single-script-tag affair now.
What's next for Banana Sensei
- More languages (the UI is Japanese-first with English glosses)
- A "banana bread timer" that suggests recipes by ripeness
- PWA offline support (the model already caches; the app shell should too)
Built With
- ai
- clip
- computer-vision
- css3
- html5
- javascript
- machine-learning
- transformers.js
- zero-shot
Log in or sign up for Devpost to join the conversation.