News for hackers. Stuff that matters.
Re:Show HN: Banana ripeness classifier (ML webapp) by gcarvalho on Monday March 04, 2019 @11:45AM (#19302589)
Hey, HN! I am colorblind and I can't reliably identify when a banana is ripe enough to eat, so I made a machine learning model that does it for me. The model (92% val accuracy, ~12MB) runs on your device (tf.js) and you can upload directly from the camera on mobile.

Feedback is always appreciated!

Data, code and trained model are available here: https://github.com/giovannipcarvalho/banana-ripeness-classif...

Re:Show HN: Banana ripeness classifier (ML webapp) by GordonS on Monday March 04, 2019 @01:31PM (#19303835)
I'm also colour blind (red-green), and can't tell ripe bananas from unripe based on the green/yellow colour. But as they ripen, they tend to develop more black patterns on them, and they're softer when you give them a little squeeze.

It's an interesting project, nonetheless, and sounds like just the sort of thing I'd like to replicate to get started in ML.

Re:Show HN: Banana ripeness classifier (ML webapp) by mrfusion on Monday March 04, 2019 @02:07PM (#19304224)
Sense of smell is the best way.
Re:Show HN: Banana ripeness classifier (ML webapp) by curiousgal on Monday March 04, 2019 @01:53PM (#19304084)
Usually it's a good idea to include another class that captures bannans in general during the training, that way it doesn't try to classify things that are not bannans to begin with.
Re:Show HN: Banana ripeness classifier (ML webapp) by anotheryou on Tuesday March 05, 2019 @08:25AM (#19310329)
I tried to guess an album covers decade: https://uncover-a-covers-decade.onrender.com/

You are doing the fast.ai course too, right? [edit: looking at your code, no, you did not :)]

I chose my challenge to maximize my learning through something challenging enough it might fail. It's only right 60-70% of the time.

What I learned:

- Binning in to decades might not be Ideal. Something from 79 and 80 is more similar than something from 71 and 79. I guess a better approach would have been smaller bins (3 or more per decade) and than rounding the result to the decade.

- Be careful how you gather your learning data. I pulled from the google image search with something like "album OR LP cover 20s/30s/40s..."; this has ~20% "best of the XXs" collections in them where the cover was designed in a much later decade. I should have searched for "1920 OR 1921 OR 1922...".

Re:Show HN: Banana ripeness classifier (ML webapp) by dbs on Monday March 04, 2019 @04:22PM (#19305658)
I just uploaded an image with some portuguese custard pies and the model went bananas.
Re:Show HN: Banana ripeness classifier (ML webapp) by simongr3dal on Monday March 04, 2019 @02:37PM (#19304522)
Nice, pretty cool project. It correctly identified some bananas I had just bought as a little green.

Any chance for making an avocado identifier, because those are pretty tough to guess wether they are ripe.

Re:Show HN: Banana ripeness classifier (ML webapp) by gcarvalho on Monday March 04, 2019 @03:27PM (#19305035)
Thanks! I might give it a shot. But yeah, I think it wouldn't work nearly as well.
Re:Show HN: Banana ripeness classifier (ML webapp) by morenoh149 on Monday March 04, 2019 @01:39PM (#19303912)
ha I made something similar for weed, https://chronicsickness.com
Re:Show HN: Banana ripeness classifier (ML webapp) by lovestodonothin on Monday March 04, 2019 @03:36PM (#19305135)
Cool website! Can you go through how you set up the whole thing?
Re:Show HN: Banana ripeness classifier (ML webapp) by gcarvalho on Tuesday March 05, 2019 @08:43AM (#19310412)
Thank you. I actually didn’t base it on fast.ai. It went on like so:

- I scraped from google images using queries like “ripe bananas”, “green bananas”, etc - Filtered out garbage images and labeled the remaining with the help of someone

- Trained the model (very straight forward with Keras). The code in the notebook is something like 30 lines I think.

- Using tf.js was what took me the longest. Using tensorflowjs_converter.save_model outputs an incompatible or corrupted file. Saving it first with keras and then using the tensorflowjs_converter CLI tool is what worked. The web-ui code is also available in the repo.

- Lastly. It is served from GitHub pages (not a problem since everything is static and runs client side), with a custom freenom domain (on a convenient .ml tld) and through cloudflare’s DNS which gives me SSL on a custom domain, caching and some very basic analytics.

Everything free tier. It only cost me time (around 5h I think).

Did I miss anything you wanted to know?

Re:Show HN: Banana ripeness classifier (ML webapp) by anotheryou on Tuesday March 05, 2019 @08:17AM (#19310300)
I'm pretty sure it's based on the fast.ai course. Their current set-up tutorial is outdated and doesn't work though.

In the forums there is a pinned thread about a docker build that works nicely on https://render.com/

fork repo, replace ML model, change html content, link to render, done https://course.fast.ai/deployment_render.html

Re:Show HN: Banana ripeness classifier (ML webapp) by dplgk on Monday March 04, 2019 @10:28PM (#19307869)
Next, can you develop Not Banana app? I think you could hit it big with that.