Knocking on Watermelons

by Victoria Suha In Fruits

Today we are going to talk about something very tasty…

W A T E R M E L O N S !

As a kid I remember going to the grocery store with my dad and seeing him knock on various watermelons to determine which one is the most ripe and optimal for eating. I never really understood the method to his madness. I would try to mimic his actions, but with my lack of patience I would just end up picking whichever one looked the most round and “tasty”.

Can you tell if a watermelon is tasty by knocking on it?

I have heard other people mention that there are tricks to determine the ripeness of a melon but I never thought to turn to academia for help. Wildly enough, there are actually quite a few papers about the acoustics of melons and the properties of their ripeness. Don’t believe me? Look at this, this, and this

Before diving into some research, I decided to conduct a mini interview with my dad to learn more about how he stumbled upon this. He told me that when he was a refugee in Pakistan he sold lots of watermelons. (He’s got a lot of stories as you can imagine.) His strategy was to bring the melon close to his ear and squeeze it to determine if you can hear it crack. According to him, the crack was a sign of the melon being ripe and a good indication that it would be tasty. He basically trained his ear to pick up on what’s tasty or not. Let’s see if science agrees with the street vendor. 

Random pic of a street market selling watermelons

For today’s post the paper I am reviewing was published in the Personal and Ubiquitous Computing Journal and it came from a team at the Future Cities Laboratory in Singapore (fancyy). The title of the paper is pretty self explanatory: “Classifying watermelon ripeness by analyzing acoustic signals using mobile devices”. The research team developed an Android app to crowd-source data for identifying watermelon ripeness in real-time while also providing data for their classification model. The main motivation of the study was to help shoppers determine if a watermelon is ripe using the knocking method I have seen my dad use. 

One of the main factors that contribute to ripeness is the sugar content in the watermelons and the authors note that different sugar levels correlate to a different acoustic response. From the start the authors cite quite a few papers that analyze the acoustic impulse response of watermelons, which means my dad’s logic was already valid. Their general characterization of ripeness is that ripe watermelons sound dull while unripe melons have a tighter and more metallic sound. 

What does a tasty watermelon sound like? 

For those who don’t eat, breathe, and sleep acoustics, the terms “dull” and “metallic” may not mean much. To better describe what the authors are talking about I decided to consult YouTube for some examples. 

I watched like 10 watermelon videos and I found it interesting how people describe the sounds. It was definitely not consistent which I can see why this may seem like more of an art than a science. Here is a short video with a good recording of watermelons at different stages of ripeness.

In case you are a weirdo and have never eaten a watermelon before, the authors of the paper also included pictures of what the inside of a ripe vs unripe watermelon looks like. 

Left picture: very tasty | Right picture: not so tasty | 🤯

Ok, now that we have a baseline on what the heck sounds tasty, let’s dive more into the paper and the app they designed. 

How does the app work? 

The process of using the app is meant to mimic a real world situation in a grocery store. Therefore, users are asked to place their mobile device near the surface of the melon while knocking on it with their other hand. From there the app:

  • Analyzes the acoustic response
  • Discards the background noise
  • Extracts the “knocking” event by detecting start and end points
  • Classifies the result
Melon science: The first battle is picking a tasty watermelon. The second battle is transporting it home…

The paper defines a few signal processing techniques to discard unwanted noise and extract the desired signal. A few of these parameters are commonly used in speech processing such as short-time energy (STE) and zero crossing rate (ZTR). For the “knocking” events, these signals can be broken down into 1800 samples (or snapshots) that are roughly 41ms long. (We are approaching math heavy territory but bear with me here.)

I am not going to cover all of their calculations but the STE measures the sum of the signal over time. If you think about this in regards to a speech segment, an “unvoiced” segment in speech will have a smaller STE. 

Speech example: unvoiced speech results in the STE close to zero. Reference is: http://cvsp.cs.ntua.gr/~nassos/resources/speech_course_2004/OnlineSpeechDemos/speechDemo_2004_Part1.html

From there they define the sub-band STE ratio to be the ratio of the STE within intervals and the total energy in a frame. They defined their sub-bands into four time intervals: [0, T/8], [T/8, T/4], [T/4, T/2], [T/2, T]. 
Hang in there!! All of this explanation leads to this graph:

Here we can see that for unripe watermelons the STE mostly drops in the first sub-band and the STE ratios drop fast across the groups. However, for ripe watermelons the sub-band STE ratios are much more flat and consistent. I dragged you through all of this just so I could go back to what I said earlier: “The authors’ general characterization of ripeness is that ripe watermelons sound dull while unripe melons have a tighter and more metallic sound.” Now we have a nice visualization for that. Yay, math!

Maybe that was too much for what looks like a simple graph but now I am going to show you a really ~FANCY~ graph as a treat for reading this far. Another form of analysis the authors completed for their data set is plotting the spectrograms of the ripe and unripe melon signals. This is a pretty common type of analysis in the audio world. A spectrogram is a visual plot of the spectrum of frequencies in a signal over time. (Quick side note, if you want to have fun playing with spectrograms in real time, check out: https://musiclab.chromeexperiments.com/Spectrogram/

Ooo fancy…I mean, tasty!!

This graph is a great visual representation of how a ripe watermelon sounds “dull” versus how an unripe watermelon sounds “tight or metallic”. The bottom graph shows that the energy drop faster with the unripe watermelon which correlates to why it doesn’t sound as hollow or dull as a ripe watermelon. Visually we can see that the spectrograms are quite different which means that you can train a model to analyze recordings and, EVEN BETTER, you can train your ears to pick up on the differences. 

Moving on, the paper goes into more detail about the data set that was used for training and classification of the model. However, what they didn’t go into is what they did with all of those watermelons after testing… What I enjoyed the most is that through all of these signal processing techniques and calculations the authors were able to develop a model with an accuracy of 89.9%! Hell yeaaah. 

The authors also included a few screenshots of their app. It definitely gives me a bit of Silicon Valley’s “hotdog or not” vibes. Unfortunately I could not find the original app on the Google Play Store anymore. This paper was from 7 years ago so I can’t say I am too surprised. But I would be lying if I said I wasn’t a little sad. 😢

Since I already started down this weird rabbit hole of melon acoustics, I decided to investigate what other melon ripeness apps are available to download. I had a bit of fun with this.

Melon apps? Huh…?

Discovery #1: Weird spelling of “Watermelon” with no downloads, a lot of math, and no knocking. Boring. *Next*

Discovery #2: Watermelon shooting! 😡 What does this have to do with ripeness? How dare you! *Next*

Discovery #3: Best & sweetest watermelon! Now we are talking. This is the closest app I could find to the one in the paper. It also asks the user to knock on watermelons and it analyzes the result. It seems fairly legit with over 100 downloads. The comic sans font is a little sketch but it seems to be the most legit from all the other apps I scrolled past. 

Bonus Discovery: This came up when I searched “watermelon ripeness” in the app store. It’s pretty irrelevant but I saw a pic of a pug so I took a screenshot. You’re welcome. Also, can we acknowledge that this app has over 10K downloads?! I clearly missed out on this ‘watermelon challenge’.

I hope you had fun geeking out with me today about the acoustics of watermelons. I enjoyed learning about how you can apply speech processing techniques and machine learning to characterizing watermelons. After reading way too much about watermelons, I feel like it is worth mentioning that there are other important factors that contribute to a tasty watermelon such as the density, color and appearance on the bottom of the melon, firmness, and sugar content.

Fact: Pugs are pretty cute when they eat watermelons.

However, I will take my dad’s tip that you can knock on melons to listen for what sounds tasty. I am looking forward to going to the grocery store and testing out my ear. I feel more confident that I can find the right melon that sounds tasty and I hope you do too. Cheers to eating tasty watermelons~

2 Comments

Manzoor June 12, 2020 Reply

The contrast between green and red color of watermelon is not only look good, but yet, sounds testy.
Now that I read your article I am going to pick my next watermelon wisely.

Thanks

Deirdre June 13, 2020 Reply

Loved this! All joking aside, I was picking my watermelons in a very unscientific way- guessing which was ripe. 🤔 It’s the perfect season to test this method for myself. 🍉

Leave a Reply