Inspiration

Part of my job is hand-grading potatoes at a non-automated potato factory, and it occurs to me how truly unique each one is -- even before factoring in the appearance of the skin, and rely on mass, volume, and dimensions alone.

It's not uncommon for potatoes to become damaged in the factory's production lines. If a potato's physical attributes (including appearance and 3D shape) are used to calculate its "fingerprint", a universally unique ID, then not only can every potato be trivially tracked from the produce washing machine to the table, but computer vision and deep-learning tactics can be applied to show that a previously good potato sustained damage (such as cuts, bruising, scraping, etc) from a specific machine or transportation process. Improving the quality of the production process serves to decrease food waste.

What it does

This proof-of-concept implementation demonstrates a basic RESTful JSON API server with a web frontend, for potato records. For now, this web client allows looking up a record given the UID, and creating a new record from raw physical data.

How I built it

We leveraged technologies and patterns I've chosen in the past for their beginner-friendliness and high iteration speed towards proof-of-concept. Specifically, browser-standard JavaScript with no npm packages or other external dependencies, HTML5, and CSS3 grid layout power the web client, while the data server runs on a multithreading-enabled (with socketserver.ThreadingMixIn) subclass of Python's builtin http.server.BaseHTTPRequestHandler implementation, to serve JSON documents in a manner that minimises implementation-specific state for the server and client.

Currently, the web client is hosted as a static website with reactive JavaScript on GitHub Pages. The data server is hosted on my laptop's localhost and tunnel-reverse-proxied to the public internet via Pagekite.me. I've previously combined these platforms for prototyping, where I eventually moved the data server to my own dedicated server, or Google Cloud Console.

Challenges I ran into

The key challenge in any user-facing application is representing data and logic in a clear and useful manner, that encourages a user to keep caring about the data and logic the way the developer does.

The web client's current interaction metaphor is dead simple -- as simple as possible to develop and use, while still being functional.

The challenge of teaching my teammates to use Git, Python and similar technologies was not a problem-challenge, but definitely a fun challenge to overcome by way of remembering how to teach new technologies.

Finding the right basic data format was quite difficult at first, and it still needs to evolve past its current incarnation, because it contains countless oversights and missing cases. (The current potato record format is described in potato.schema.json.)

Other hard problems omitted as current features due to time constraints were:

  • simply and deterministically stitching images of a potato's surface appearance into a rectangular image texture, without information loss due to cropping
  • describing and using a 3D shape representation to capture the physical shape and volume of a potato
  • implementing similarity algorithms on the images, 3D information and data points, to show, e.g., that a potato with significant damage previously had a certain fingerprint, or that two broken pieces of potato previously made up a single potato with a certain UID

Accomplishments that I'm proud of

I'm proud that my team and I were able to produce a proof-of-concept application from this sort of abstract idea. This is my first hackathon, and our team started Day 1 with no clue what our project would be.

Given that our team began pretty unfamiliar with Git and GitHub, I'm proud of our iteration speed on both the front and backend -- about 24 commits to the frontend in 2 days, and the backend server took just 6 commits to get to its current incarnation.

What I learned

I've learned how (and how not) to iterate quickly on an idea in a hackathon environment, while collaborating with and helping my teammates, and I've learned how to balance complexity with YAGNI and KISS principles.

What's next for potato-id

The data model will be redesigned first, because this implementation has highlighted its flaws. It's very important to have incarnations of projects that don't reach the perfect implementation, because it demonstrates how the next implementation should improve.

Once the data model is realistic and representative, focusing on the hard image- and shape-processing problems must come next, as they make-or-break the real-world application of this idea.

Inspiration

After viewing the impact of hunger is communities food waste is often at the forefront of society's problems. Once way to decrease waste is to track damaged produce. Potatoes are very unique from one another and therefore lend themselves to being tracked easily. By tracking and monitoring the percentage of damaged potatoes we can ensure that each potato first goes to human food first, then if not for human consumption to animal feed. If it is not fit for consumption at all it can be returned to the ground as compost.

What it does

This proof-of-concept implementation demonstrates a basic ability for potatoes to be tracked through a back end server to a front end web interface. A user can search each potato by it's unique user identification number assigned while a modeling camera examines each potato for unique markings and characteristics.

How we built it

We built this by creating a server in python that would store data about each potato and then assigning it a unique identification number. This server was then connected to a web interface that was created in HTML5, CSS, and CSS grid by using Javascript.

Challenges we ran into

Several of our teammates did not know how to use github or know javascript. We have to each learn how to use those to different degrees. Also, connecting the user interface to the server proved to be difficult.

Accomplishments that we're proud of

We are proud of the ability for our team to work to our coding strengths and teach eachother what others did not know. I personally am proud of learning to how use github and realizing how good my javasript skills were.

What we learned

I learned to to commit to repositories on github. I also learned more efficient ways to use HTML5 and CSS. I also learned how to use javascript in a real world applicaiton.

What's next for potato-id

Potato-id is a hopefully efficient way to track and possibly reduce food waste in potatoes. Next it could hopefully been expanded to other forms of produce to track and decrease food waste. Potato-id could also be used to track damaged potatoes to ensure that they find a useful end rather than just be discarded.

Share this project:

Updates