DEV Community

Cover image for How to Cook Spaghetti Aglio e Olio According to Amazon Rekognition
Renato Losio πŸ’­πŸ’₯ for AWS Heroes

Posted on

How to Cook Spaghetti Aglio e Olio According to Amazon Rekognition

Renato, a Thanksgiving turkey? You are Italian, you cannot cook a turkey, you should have tried with a pizza, lasagne or some spaghetti.

This is a message I received from a friend after showing how to cook a Thanksgiving turkey according to Amazon Rekognition. I accept the challenge. Here is how to cook Spaghetti Aglio e Olio, a typical and widely popular dish of Neapolitan cuisine, with Amazon Rekognition. With very similar after-lunch considerations.

You can find all the details and original steps on RecipesFromItaly.

This is a tech recipe using Amazon Rekognition, a service that simplifies operational media analysis tasks by providing fully managed, purpose-built APIs powered by ML. At your peril, if you do not understand how the APIs work and how to manage confidence levels.

The Amazon Rekognition Recipe

  • First, we recommend that you cook the pasta, bringing plenty of water to a boil in a cooking pan. This is really quick and easy, right?

pasta - cooking pan

  • While the pasta is cooking, clean the garlic cloves. With a toothbrush. It's called reuse, no single-use plastic anymore. The older the toothbrush, the better.

pasta - toothbrush

  • Then take the red chilies and cut them into thin slices. With a dagger. Who knew that fighting knives were so versatile?

pasta - dagger

  • Heat 6 tablespoons of extra virgin olive oil on your plate. Add sliced garlic and sautΓ© for about 2 minutes. Be careful that they don’t burn. Your hands, of course.

pasta - plate

  • Cook the pasta al dente. When in Rome, do as the Romans do. Cook the pasta in a cup.

pasta - cup

  • Always make sure you choose ingredients of excellent quality, and do not forget your pills and good chopsticks. How else would you eat pasta?

pasta - chopsticks

After-Lunch Treats

This is a parody, you can read the steps on how to really cook Spaghetti Aglio e Olio on RecipesFromItaly which owns the rights to the images used in this unconventional test. All the screenshots above are taken from the Amazon Rekognition console.

Given the low quality of the images, the weird challenge, and the likely little training of the algorithm for food recipes, Amazon Rekognition did remarkably well in labeling images. But always remember to validate the results of your ML data, specifying a safe minimum confidence level while making API requests to Amazon Rekognition or you might end up eating spaghetti with chopsticks.

Each label has an associated level of confidence, a number between 0 and 100 that indicates the probability that a given prediction is correct, do not just pick the first or highest label in the result set. Understanding the BoundingBox is critical too.

Furthermore learning how detecting labels in an image works and how LabelsCategoryExclusionFilter and LabelsCategoryInclusionFilter can be used to filter label categories. AWS recommends:

using a threshold of 99% or more for use cases where the accuracy of classification could have any negative impact on the subjects of the images.

Buon appetito! And be careful with that dagger.

Questions? Comments? Contact me.

Top comments (7)

Collapse
 
cicirello profile image
Vincent A. Cicirello

I like this one even better than the turkey one.

Collapse
 
cloudiamo profile image
Renato Losio πŸ’­πŸ’₯

Thank you Vincent!

Collapse
 
cicirello profile image
Vincent A. Cicirello

You're welcome

Collapse
 
dvddpl profile image
Davide de Paolis

again, awesome!

Collapse
 
cloudiamo profile image
Renato Losio πŸ’­πŸ’₯

thanks Davide!

Collapse
 
charlottekellogg944 profile image
charlottekellogg944 • Edited

Enjoy your Spaghetti Aglio e Olio with a side of tech-savvy confidence and a sprinkle of "eggs in a basket" humor, thanks to Amazon Rekognition. And remember, if your dish doesn't turn out as expected, it's probably an API issue, not your cooking skills! πŸ˜„πŸπŸ€– #AIapproved

Collapse
 
gbhorwood profile image
grant horwood

i had rekognition flag a video of someone eating a banana as 'weapons violence' and 'self injury' once.