default-header
HomeCombined analysis of accelerometer and GPS data

Combined analysis of accelerometer and GPS data

Thursday,  December 12, 2024

I am delighted to inform you about a set of open-source software tools I have been working on for the Habitus project led by Jasper Schipperijn. I already mentioned this project in a blog post from 2020, so I think it is time for an update. The tools I worked on, named hbGPS, hbGIS, and HabitusGUI, aid the combined analysis of wearable accelerometer and GPS data. Here, I focussed on data collected with GPS sensors from the brand Qstartz. However, the accelerometer part of the functionality should be applicable to any accelerometer brand.

Earlier this year, Teun Remmers and Dave van Kann at Fontys University, who co-funded the development, successfully used the tools in a research publication. Nonetheless, we think ongoing community efforts are needed to improve the tools for use in the wider research community. In this blog post I summarise to you:

  • The work that has been done.
  • The additional work that we think is needed.
  • How you as research community can help move the project forward.

Why new tools?

Using GPS and accelerometer data for tracking human behaviour is not new. In fact, the research community has explored various tools and algorithms. Unfortunately, many of the tools that have been used in the past were not well preserved. For example, the PALMS software for detecting trips from GPS data and the software named palmsplus for matching PALMS output with GIS data are no longer maintained and available.

Efforts have been made to address this by the Python library PALMSpy which aims to reimplement PALMS and by R package palmsplusr which aims to replace palmsplus. However, these come with a couple of challenges:

  • PALMSpy has primarily been developed to work in a cloud environment and not on desktop computers for small scale usage. Further, PALMSpy has been tailored to older count-based activity monitor data that is no longer collected, has no functionality to estimate whether a person is indoor or outdoor, and is only functional for a limited number of GPS csv-file formats.
  • palmsplusr has been designed to be used interactively by the user and not as a dependency inside other software.

Additionally, the combination of Python and R complicates the local installation and usage for non-tech skilled researchers. It is technically possible, but not ideal.

Initial efforts to address the limitations were not successful and led me to develop new tools.

Main characteristics of each tool

hbGPS

R package hbGPS aims to replace PALMSpy and PALMS. Just like PALMSpy and PALMS, hbGPS identifies trips from GPS data and fuses this with accelerometer data. However, instead of having its own accelerometer data processing functionality, hbGPS fully relies on R package GGIR. GGIR facilitates both historic and modern accelerometer data formats and offers wide variety of data processing options. Another advantage of hbGPS over PALMSpy and PALMS, is that hbGPS can easily run on a laptop.

Please note that hbGPS does not attempt to replicate PALMS or PALMSpy but has its own new algorithm for trip detection. It is a simple knowledge-driven algorithms to offer intuitive base functionality. Needless to say, that we do not exclude adding data-driven techniques in the future.

hbGIS

The hbGIS package is a re-implementation of R package palmsplusr, developed by Tom Stewart, but revised to ease usage as dependency inside other software. For example, the package now offers a single central function interface and allows for configuration files. Furthermore, the hbGIS is primarily intended to facilitate the following scenarios:

  1. Time spent in and travel in between locations that participants are affiliated with (e.g. children and their school) and participants individual reference location (e.g. home).
  2. Time spent in and travel in between specific public location participants are not affiliated with (e.g. central park and beach park), or broader categories of those pubic locations (e.g. parks).
  3. Combinations of 1 and 2.

In the output you will find a summary of travel and physical behaviour per time point, per day, per trip, per recording, and location. This code is mostly based on an R script provided by Tom Stewart, which I restructured to fit inside hbGPS.

HabitusGUI

HABITUSGUI is a Shiny app that acts as GUI to configure and start the analyses of wearable sensor data and GIS data with GGIR, hbGPS, and/or hbGIS. I initially developed this Shiny app with a cloud environment in mind as PALMSpy could only run in the cloud. However, since hbGPS and hbGIS can both run fast on a desktop computer it may be considered less essential to use the Shiny app as all tools can also be used from the R environment directly.

Documentation

Each of the above mentioned packages has its own documentation, but additionally Josef Heidler created a more high-level documentation overview page.

Interested in helping to move the project forward?

I would like to invite you to help via any of the following:

  • Test the software tools and report problems, ideally via the repositories’ issue trackers.
  • Review and possibly revise terminology. In my opinion the terminology has been ambiguous with abstract terms like domains, fields, trip, journey, trip segment, and trajectory used alongside each other without consistent definitions. I believe that improving the taxonomy and construct definitions will be an essential step towards improving the software quality.
  • Collect or share data to help formally evaluate the tools in a publication.
  • Evaluate the tools and describe them in a publication. We already tested the tools in various datasets, but a more systematic evaluation would be good. To facilitate the description of the tools, I included a narrative description of the software here for hbGPS and here for hbGIS.
  • Improve user-friendliness based on user feedback.
  • Volunteer to help continued development and maintenance of the software.
  • Explore opportunities to enhance the functionality. For example, can we detect specific modes of transport?
  • Find funding to sponsor efforts related to any of the above.

Please let me or my project partners know if you would like to brainstorm about any of these options.

Acknowledgements

Lastly, I would like to thank:

  • Jasper Schipperijn, Josef Heidler, Teun Remmers and Dave van Kann for the productive brainstorm sessions.
  • Josef Heidler, Line Matthiesen, and Teun Remmers for helping to test the tools in a variety of datasets.
  • Tom Stewart for developing palmsplusr and for helping me to navigate the code.
  • Jairo Hidalgo Migueles for help with the HabitusGUI development in 2023.
  • Jasper Schipperijn and Dave van Kann for your trust in me as consultant.

 

Combined analysis of accelerometer and GPS data
Photo: