Jacky Lam

Teaching a Computer to Tell Food From Menus

· 5 min read

A wall of small screens, each showing a different photograph, arranged in a tight grid

I keep a personal guide to restaurants in NYC. Each restaurant has a photo carousel, and the whole point of a food guide is that you see the food.

The photos come from Google Maps, and that’s where the trouble started. Google hands back a restaurant’s top photos, and they’re a grab bag: a plate of noodles, then a close-up of the menu, then the storefront, then an empty dining room. Open a restaurant page and the first picture might be a laminated menu. Nobody scrolls a food guide hoping to read a menu in a bad photo.

I wanted food first. Doing that by hand for about 50 restaurants and roughly 450 photos is possible, but it’s tedious, and I’d have to redo it every time I added a restaurant. So I looked for a way to have a computer sort them.

A quick note on how this was built

I built this with an AI coding assistant, and I want to be upfront about that. I’m a data engineer, not a computer vision person. I knew what problem I had, but I didn’t know the right tool for it, and I couldn’t have written the code from a standing start.

The assistant helped me find an approach and write the code. I looked at what it produced on real photos and decided whether it was good enough. That split worked well for me, and it’s how I’d like to describe it honestly: AI helped me build something real that I use, and I’m still the one responsible for whether it works.

The idea: let an AI model describe what it sees

The tool is called CLIP. It’s an AI model that has learned to connect pictures with words. You show it a photo and a few short descriptions, and it tells you which description fits best.

That means I don’t have to train anything. I just write down what I’m looking for in plain English.

For this project I wrote two short lists:

Looks like food Doesn’t look like food
“a photo of food” “a restaurant storefront exterior”
“a close-up of a dish” “an empty restaurant interior”
“a plate of food on a table” “a dining room with tables and chairs”
“a drink or beverage” “a menu or restaurant sign”
“a bakery display case full of pastries” “a logo or printed menu”

For each photo, the model scores how well it matches every description. I add up the scores for the food list and the non-food list, and whichever side wins, that’s the label.

Leaning toward food on purpose

A computer that’s unsure will sometimes guess wrong, and the two kinds of mistakes aren’t equally bad.

If a great food photo gets labeled “not food,” it gets pushed to the back and hardly anyone sees it. If a menu photo gets labeled “food,” it sits at the front and looks a little silly. I’d rather risk the second one, so I added a small thumb on the scale. A photo only counts as non-food if that side wins by a clear margin. Close calls stay in the food pile.

Nothing gets deleted

The tool doesn’t throw photos away. It makes a list of the ones it thinks aren’t food, and the website moves those to the end of each carousel. The storefront is still there if you swipe far enough, which is nice when you want to know what the place looks like from the street.

The list also remembers earlier decisions. If I fix a label by hand, running the tool again won’t overwrite my fix unless I tell it to. That small rule makes it much safer to run whenever I add new restaurants.

The model runs on my own laptop, so there’s no extra bill and no photos get sent anywhere.

A different problem I found along the way

While downloading photos I ran into something unrelated. Occasionally Google returns a tiny, solid black image instead of the real photo, usually when the original was removed. A real photo is never that small, so the download script now refuses to save anything under about 10 KB. Not glamorous, but without it, black squares would have ended up in the guide.

How it turned out

The list now flags 121 photos across 43 restaurants as non-food. Some of that comes from an earlier pass where I sorted a few by hand, and the tool kept those. Open a restaurant in the guide today and the food comes first.

It isn’t perfect. A dish photographed from far away can look like “a table,” and an odd menu board can fool it. I haven’t put a formal accuracy score on it, and I wouldn’t claim one. For a personal guide, “mostly right, and easy to fix by hand” was the goal, and it hits that.

What I took from it

  • Describing what you want in plain words is a surprisingly good way to start with AI. I didn’t need a pile of labeled examples.
  • Pick which mistake you can live with. Leaning toward food was a product decision, not a technical one.
  • Keep the human override. Anything automated needs an easy way for me to say “no, that one’s wrong.”
  • AI assistance is a tool, not a shortcut around judgment. The assistant got me to a working version quickly. Looking at the results and deciding what counted as good was still my job.

If you’re curious, the whole thing lives in the NYC Guide. Check how many restaurants lead with a photo of an actual dish.


Keep reading

November 24, 2026 · 7 min read

Making Five Cities' Transit Data Speak the Same Language

Every transit agency publishes its data a little differently. Here's what it took to turn 17 of them into one simple arrivals app, the bugs along the way, and how I built it with an AI coding assistant.

February 24, 2026 · 9 min read

I Automated the Most Tedious Grind in Final Fantasy VIII

Maxing stats in Final Fantasy VIII is less 'challenge' and more 'press confirm for eight hours.' I wrote a Python script that handles the whole grind with simulated keypresses.