The world’s leading publication for data science, AI, and ML professionals.

Brushing teeth can be more “busier” than what you think

Value out of Activities of Daily Living (ADL) using power of data science

You wake up. You brush your teeth. Sounds pretty mundane. But activity such as brushing teeth can generate a huge amount of data. With this data we can see that even a mundane activity such as brushing teeth can be a "busy" or "hectic" activity. In this article we will use data science to see how busy brushing teeth can be compared to walking

In the data science world Daily Activities such as brushing teeth, climbing stairs, combing hair, descending stairs, drinking, lying down, walking are termed as Activity of Daily Living (ADL). With technology such as wrist-worn accelerometer these activities can be measured with lot of precision

In this article we will analyse such an accelerometer dataset and see how data science can help us answer some interesting questions about daily activities.

Dataset to illustrate

The data set used here is one available on UCI Dataset (Dua, D. and Graff, C. (2019). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science)

The dataset contains data collected from wrist-worn accelerometer. An accelerometer is an electromechanical device used to measure acceleration forces. Acceleration is the measurement of the change in velocity, or speed divided by time. Accelerometers can measure acceleration in three direction. For a person, X direction is acceleration in along forward and backward direction. The Y direction is acceleration sideways and Z direction is acceleration in top and bottom direction

Accelerometer direction from human perspective
Accelerometer direction from human perspective

Question: How does daily activity data look like

We know all our activities such as brushing teeth or walking. But how does the accelerometer data look like ? In order to visualize this data , we can plot it using line plots. In graphic below we see acceleration in X,Y,Z direction for walking and brushing teeth activities.

Accelerometer data while walking
Accelerometer data while walking

We observe that graph for X-direction has more variation than Y-direction. This is because when we walk we do not much move side-ways

For the accelerometer graphs of brushing teeth are shown below.

Accelerometer data while brushing teeth
Accelerometer data while brushing teeth

We see that the graph for brushing teeth are very dense in some parts as compared to walking. This is because the brushing activity has more acceleration as compared to walking

Question: Can data prove that brushing is faster activity than walking

In order to answer this question, we need to understand how to measure "fast". When data is a time-series , the "fastness" can be measured in terms of frequency. Frequency is number of occurrences of a repeating event per unit of time.

From walking perspective frequency means number of steps taken in a given time. From brushing perspective frequency means number of brush strokes made in a given time.

Converting time series data into frequencies can be by algorithm called Fourier transformation.

For simplicity lets only consider accelerometer data in X-direction. Let’s take the walking accelerometer data in X-direction and convert it to frequency using Fourier transformation algorithm. The result looks like this

Fourier transformation of walking data
Fourier transformation of walking data

For walking time series data , Fourier transformation shows that most of the frequencies present are low frequencies. This means that during walking , the number of steps taken in given time are relatively less.

Fourier transformation also gives the amplitude of frequency. The amplitude is the size of frequency. For walking this can relate to size of steps. For example you can take 5 large steps or 5 small steps in a given time. The frequency is same (5 steps), but the amplitude of small step walk is less than amplitude of large steps walk

Similar analysis for brushing teeth shows that there is presence of low as well high frequencies.

Fourier Transformation of brushing data
Fourier Transformation of brushing data

As we see that brushing involves high frequencies, we can conclude that brushing is faster than walking

Question: How "busy" is brushing compared to walking

Data justifies that brushing activity is more accelerated (or fast) compared to walking. But how "busy" or "hectic" is brushing compared to walking

In order to answer this question, we need to come with a number which indicates "busy-ness" of the activity. One possible way is to see length as well as amplitude of frequency. From walking perspective this means is to how fast one is walking, for how long as well as length of steps. From brushing perspective this means how fast is one brushing , for how long as well length of each brush stroke. From Data Science perspective this is called power of frequency. It is also required to calculate power of all frequencies. The algorithm which calculates power of frequency is called Welch algorithm

The plot of frequency vs power is called Spectrogram

Power Spectrogram of Walking and Brushing
Power Spectrogram of Walking and Brushing

The total area under the spectrogram curve is also total power of all frequencies. The area under curve can be calculated with Simpson rule.

We see that total power of walking is 13.5 and total power of brushing is 95.1. So the brushing is 95.1 / 13.5 = 7 times "busy" then walking

So next time when you are brushing your teeth , even after you are still sleepy, you are still "busy" 7 times more than a walk in a garden

Additional resources

Website

You can visit my website to make analytics with zero coding. https://experiencedatascience.com

Please subscribe to stay informed whenever I release a new story.

Get an email whenever Pranay Dave publishes.

You can also join Medium with my referral link.

Join Medium with my referral link – Pranay Dave

Youtube channel Here is link to my YouTube channel https://www.youtube.com/c/DataScienceDemonstrated


Related Articles