Ask your phone if you are pregnant

You pull a face when you read the instructions. “Immerse the strip into the urine.” And you pee. Into a cup. And immerse the strip, as you’ve been instructed to do, “into the urine”. You count down: Three, Two, One. Then you lay the test flat onto a surface, making a mental note to clean it afterwards. And now you wait, for 5 minutes, trying not to peek, until the vital information is ready: pregnant or not pregnant.

Pregnancy tests have required women to pee on objects since 1350 BC; the objects have changed from wheat and barley to paper strips, but the experience has remained unsettling — Especially when you consider the mental state a woman is in when taking a pregnancy test. She may have tried to conceive for a long time, or may be anxious that she has conceived without wanting to. In any case, many women are weary when testing pregnancy, sitting anxiously in their bathroom waiting for results. Pregnancy tests can be expensive too. The average price of a test kit is about $10, and you can use each test only once, which means you have to buy a new one every time you want to run a test. This quickly adds up. Social media is full of trying-to-be-parents complaining about the amount they spend on pregnancy tests. What if there was an alternative to one-off pregnancy tests? Modern computer technology could revolutionise pregnancy tests.

A brief history of the at home pregnancy test

Women have used pregnancy tests at home for over 40 years. The first at home pregnancy test was created in 1967 by Margaret Crane and became available in US stores in 1977. Before women could test pregnancy at home, they consulted a laboratory that would then test their pregnancy with the ‘Bufo’ test. The Bufo test is both fascinating and disturbing: women would deliver a urine sample, which was then filled into a syringe and injected into a female toad. If the woman was pregnant the injected female toad would produce eggs within a day. Something in the urine of pregnant women makes toads produce eggs. Today we know that this ‘something’ is hormones, and pregnancy has a large effect on hormones in the female body.

Testing pregnancy with a strip of paper

The kind of pregnancy tests you are used to seeing today are paper strips, embedded in plastic, which measure hormones in the urine of women. The hCG hormone is detected by many urine pregnancy tests as it indicates pregnancy early on: hCG increases during the first two months of pregnancy and then plummets.

Hormones affect womens’ bodies

Many of the changes a woman’s body undergoes during pregnancy involve growth. Of course her belly, but also her breasts, feet, hands, and even vocal cords swell and feel different than they did before getting pregnant.

Hormones affect women’s voices

Hormones affect voices and can transform them; This is why we all live through a vocal change during puberty. It is also why men and women sound differently, with men having deeper voices than women. Effects of hormones on female voice have been studied for decades and researchers agree that female voices are affected by hormonal changes in their bodies. Female voice is sensitive to hormonal changes, so sensitive that researchers have found female voice to signal ovulation, the time of the month a woman is most fertile. A women’s voice becomes brighter shortly before ovulating. Listeners can perceive this and they find female voices most attractive when women are most fertile. This may allow couples — without being aware of it — to have sex at the right time to conceive.

Voice also changes during pregnancy. During pregnancy voice becomes more hoarse, deeper and scientists find that pregnant women have difficulties holding a tone for a long time. Professional female singers report that their voice can change so dramatically in pregnancy that they have to stop performing. After giving birth women’s voice changes back to normal.

Quantifying voice

Some people can hear how voices are changing in pregnancy, but many of us, including the author of this post, are neither that gifted nor well trained. Therefore it is useful to come up with ways to objectively quantify changes in voice. For quantifying voice you need essentially two things: technology to record voices and technology to analyse them. Microphones were reserved for specialists not too long ago; only researchers and media professionals would have had easy access to microphones. This has changed dramatically with modern, low-cost smart phones: about 69% of Americans own a smartphone and can easily record their voice with the built-in microphone and voice recording apps.

Today many of us can easily record their voice, but how do you quantify voice? Voice is complex and has many features like brightness, intonation and hoarseness, and it is not obvious how to quantify these. People are good in noting whether someone’s voice sounds hoarse, but how do you tell a computer that’s a hoarse voice? With modern technology this problem can be solved: instead of telling a computer that’s a hoarse voice, computers can learn by themselves what a hoarse voice is. Learning computers are sometimes described as having ‘Artificial Intelligence’. The technology making this possible is inspired by how the brain works and called deep learning. Computers can essentially learn to differentiate abstract features of voices, like hoarseness. Recently researchers have used deep learning to analyse voices of patients with astounding results: with this voice analysis technology researchers can accurately diagnose conditions like Parkinson’s, heart disease and depression.

Voice pregnancy test

Why not use voice analysis technology to detect pregnancy? In the future we could see a revolution in pregnancy testing. Women could ask their phone: “Hey, do you think I am pregnant?” and get an easy, quick, and accurate response.

Authors: Birgit Brüggemeier, Linda Börner

How does detecting pregnancy from voices work?

Voices are sensitive to hormonal changes. That’s why your voice changes during puberty. When we think of vocal changes during puberty, we usually think of how voices of boys change, because it is so obvious: even when boys try to hide their vocal change, we notice it.

However also girls’ voices change during puberty, less obviously than male voices, but they do change. Hormones affect female voices, even during their menstrual cycle and during pregnancy. Many of us do not perceive how our voices change, as it does not affect our everyday life. Professional singers and actors pay a lot of attention to their voice, and they report how hormones can affect their voice. In this article in the Huffington Post the professional singer and vocal coach Ruth Gerson writes about how pregnancy affects her voice.

We want to pick up changes in voice that many of us are not aware of. For that we require good technology. We have good technology. In fact, we use state-of-the-art technology that is also used by companies like Google and Microsoft to analyse voices.

However we need voice samples for improving our technology. For detecting whether a voice sounds pregnant, we need to compare it with voices of pregnant and non-pregnant speakers. That is why we have developed an app that allows you to donate your voice. We call our app Mantra and you can download it on the Google Play Store and on the Apple App Store.

Voice pregnancy test

We want to develop a ‘voice pregnancy test’, a pregnancy test, that works by analysing characteristics of female voice. We will train computers to differentiate voices of pregnant and non-pregnant women. Instead of buying one-time pregnancy tests, women could ask their phone: “Hey, do you think I am pregnant?” And their smartphone could give them a response. To build such a voice pregnancy test, we need lots of voice recordings to train our software. And you can help by donating your voice or backing us on kickstarter!

Ask your phone if you are pregnant! Support us developing a voice pregnancy test.

Ask your phone if you are pregnant! Support us developing a voice pregnancy test.

Not available

Female fly choice

Imagine, you are in a white room and it is quiet. And there is this guy with you and he is frantically running around you while he is strangely quiet. He is freaking you out, you want him to leave. But then you start to hear singing. It seems to come from this guy and it sounds beautiful. Someone who can sing that beautifully, can’t be that bad. Actually he is kind of cute in his frantic way. So you allow him to get closer, you allow him to touch you and end up having sex with him. It is a bit odd that he continues singing all along, but you don’t mind, you like his song.

This is the actual setting that a female fly finds herself in when I am doing my experiments. She is locked in a white room, which we call courtship chamber, together with a muted male, that she finds unattractive as she runs away from him and kicks him when he comes too close.  And then, at one point, I start playing back fly courtship song to them and the female’s behaviour changes. She slows down and allows the male to come close and finally copulates with him. However, females are picky, and do not copulate to any song, no, it needs to be the right one.

And I find that the right song needs to have the right song amplitude structure, that is the right way to vary in volume. In specific females like song amplitude structure typical for their own species, which you can see from these data that show what percentage of females copulate to their own species song and to a different species song:

FemaleFlyChoice

Not available

Strikingly females from both species, copulate more when hearing a song with their own species song amplitude structure, however they don’t like song with another species song amplitude structure. Actually the song is rendered as unattractive as silence, which when you think back to the beginning of this post must be really unattractive.

What’s your favourite song, fly?

When I want to know what’s your favourite song, I just ask. It’s as simple as that. But how do you ask a fly what’s their favourite song?

Clearly, flies cannot tell me what song they like as a person could, but you can tell what songs flies like from their behaviour. This is because, when flies hear a song they like, they change their behaviour, they actually start to dance and sing along – no kidding. Well it’s a bit more complicated than that as only male flies actually sing along, but both males and females start dancing, or as scientists would say, they increase their locomotor activity and chase one another. But really, moving and chasing is what a dance is, so I will call it dancing.

Flies don’t dance and sing to any song, no, they are picky. For example they don’t sing to Travis’ Sing, sing sing despite the clear encouragement to sing.

Flies only dance to songs that meet certain criteria: they need to be at the right frequency and come in the right rythm. The right frequency and ryhthm are determined by the species the fly belongs to, as fly species sing differently and like their species’ songs most (see my post from the 27. April ’16).

So how do we find out what songs flies like? We need flies, a speaker, fly song for playback, and fly chambers to prevent flies from escaping. You then place flies in the chambers and start playback. If flies like the song they’ll start dancing and females become more willing to copulate (note it’s female flies, not humans).

I am interested to find out whether flies care about variations in volume over time. So I designed fly songs with variations that are typical for three different species: melanogaster, simulans and yakuba. For that I calculated the mean gain for each species, generated an envelope with that gain and masked songs of the three species, as you can see here:

mask_song_with_gain

So which of the songs do flies like? I will let you know in the next post.

Very variable volume – Decoding song amplitude structure in flies

„Louder!“ The radio plays that film music that gives me the creeps: Lux Aeterna. It is an orchestra that starts off quiet and then grows into a loud storm, while in the film banality grows into horror. However it’s not the film, but the music that makes me feel uncanny. Now imagine the violins kicked in loudly and continued loud – that’d feel different, maybe even boring, wouldn’t it? Variations in volume are frequently used in music, which is why they have technical terms as ‘crescendo’ and ‘decrescendo’ describing increasing and decreasing volume respectively.
However I am not a musician, but a scientist and want to tell you about crescendos and decrescendos in the song of fruit flies. Yes, flies sing! Check out this video to see how. You can see increasing and decreasing volume in this image of a fly song recording:

FlySongSample

Remarkably, other flies make sense of these variations in song volume: flies like volume variations typical for their species better than others. Finding what volume variations are typical for a fly species is not trivial, but doable. I illustrate it in this flowchart:

IllustrateSAS2

First I define song amplitude structure (SAS) as volume increase across a local volume peak (circled dots) followed by decrease to a local volume minimum. Then I detect pulse maxima and minima (dots) in courtship song recordings and arrange the pulse peaks relative to SAS peaks. Finally I present SAS data as a heat map. You can think of this procedure as decoding a temporal structure encoded in fly song. This uncovers a diamond-like structure that differs between species, as you can see here:

HeatMapSpeciesSAS_and_songsamples

Flies imaged by Nicolas Gompel.

But how do flies produce these structures? And how can you test what structures flies like? This post is too long already, so I’ll try to answer these questions in later posts.

Stats Visualisation

While looking up Cohen’s d, an effect size for significance testing, often used by psychologist, I came across a website that does a great job in visualising standard statistics: rpsychologist.com

My personal favourites are Interpreting confidence intervals, as it visualises the dynamic nature of sampling over time and Understanding Statistical Power and Significance Testing because of this quote:

“What’s wrong with [null hypothesis significance testing]? Well, among many other things, it does not tell us what we want to know, and we so much want to know what we want to know that, out of desperation, we nevertheless believe that it does!”

– Cohen (1994)