Nothing Special   »   [go: up one dir, main page]

SpectraVue - An Interactive Web Application Enabling Rapid Data Visualization and Analysis for Wearable Spectroscopy Research

Tarek Hamid, PRECISE Center, University of Pennsylvania, United States, thamid@seas.upenn.edu
Insup Lee, PRECISE Center, University of Pennsylvania, United States, lee@seas.upenn.edu
Amanda Watson, Department of Electrical and Computer Engineering, University of Virginia, United States, aawatson@virginia.edu

Spectroscopic analysis of physiological phenomena has remained an important yet underutilized application in wearable technology today. Lumos has recently been introduced as an open-source wearable device capable of on-body spectroscopic research across the visible spectrum, enabling scientists and researchers to study the optical properties of various clinical biomarkers in real-time. However, a key limitation in the data output of this device is the lengthy process required to visualize and plot the spectral responses of observed mediums. In this paper, we present SpectraVue, an interactive web application that allows for visualization of Lumos spectral data. Utilizing a user-friendly interface, SpectraVue enables researchers to quickly generate three-dimensional plots from Lumos data stored in csv or text files, providing a comprehensive view of the spectral response of the medium under investigation. Additionally, SpectraVue offers features such as comparison of spectral data with a clinical biomarker, various data export options, and interactive plotting, further enhancing the user experience and researcher efficiency. The output graphs can be used to provide a standardization of spectral responses across a wide range of mediums, including characterization of these responses in clinical biomarkers such as glucose and alcohol. SpectraVue aims to facilitate these investigations by streamlining the data processing and visualization workflow, thereby accelerating clinical diagnostic research.

Figure 1
Figure 1: Landing page of the SpectraVue Platform. User inputs are accepted in the widget on the left, and the output graph is generated on the right. The platform is currently split into two modes: spectrometer mode and biomarker mode.

Keywords: spectroscopy; wearable technology; visualization; web application; Plotly Dash

ACM Reference Format:
Tarek Hamid, Insup Lee, and Amanda Watson. 2023. SpectraVue - An Interactive Web Application Enabling Rapid Data Visualization and Analysis for Wearable Spectroscopy Research. In Adjunct Proceedings of the 2023 ACM International Joint Conference on Pervasive and Ubiquitous Computing & the 2023 ACM International Symposium on Wearable Computing (UbiComp/ISWC '23 Adjunct), October 08--12, 2023, Cancun, Quintana Roo, Mexico. ACM, New York, NY, USA 5 Pages. https://doi.org/10.1145/3594739.3610709

Figure 2
Figure 2: SpectraVue is an open-source interactive web application that allows for rapid analysis and visualization of wearable spectroscopic data. One of the features of the platform is the ability to compare data with a clinical biomarker. Left: spectrometer data at ts = 1800; middle: spectrometer data at ts = 4800; right: associated biomarker data, with markers for the denoted timestamps.

1 INTRODUCTION

On-body spectroscopic research has typically been limited to wavelengths in the near-infrared (NIR) spectrum, limiting researchers from the analysis of optical properties of various physiological phenomena in real-time [2, 8]. Lumos was recently introduced to bridge this gap, enabling wearable spectroscopic research in wavelengths across the visible spectrum, including NIR, with potential applications to glucose and alcohol blood monitoring [10]. The open-source nature of the device allows for customization and collaboration among researchers, fostering the development of new digital biomarkers in the space.

While the output data from this device is rich and substantial, there exists several barriers to rapid device adoption and analysis:

  1. Time - setting up the appropriate pipelines for data visualization and analysis across different tests can be challenging and time consuming.
  2. Upfront technical cost - since the data must be processed in a manner that is fairly complex, it requires solid knowledge of data manipulation tools (Python, MATLAB, etc.).
  3. Lack of existing, standardized data processing pipelines - considering the novelty of the device, there does not exist a standardized way of visualizing and analyzing Lumos data.

In this work, we introduce SpectraVue, an interactive web application that enables researchers to quickly process, visualize, and analyze data from the Lumos wearable spectrometer. The application is minimal, easy-to-use, customizable, and allows for standardized, rapid processing of Lumos data. The goal of the platform is to accelerate research in this space by streamlining data processing and visualization, empowering researchers to gain valuable insights from Lumos data efficiently and effectively.

2 APPLICATION DESCRIPTION

In this section, we introduce the features of SpectraVue and the utility it can provide to researchers using the Lumos device. First, we give a brief overview of the application, including its modes of operation and user flow. Next, we discuss the various data formats and files the application accepts, and other user parameters that are required for graph generation. Finally, we discuss the different plots that are generated based on these user inputs.

2.1 Application Overview

The application was developed using Plotly Dash [6]. Dash is especially useful for this application for several reasons:

  1. Allows for the use of existing Python numerical and scientific libraries that are typically used in prototypical research workflows.
  2. Allows for the rapid creation of graphs and dashboards, while still maintaining customizability relative to other tools such as Tableau and PowerBI.
  3. Abstracts away the need for intensive application set-up relative to other web application development tools such as JavaScript.

Figure 2 displays the landing page when the application is initially launched. The application consists of user input and an adjacent generated graph or video, depending on the mode of operation. The application can operate under two modes: spectrometer mode and biomarker mode. The spectrometer mode is intended for those who simply have Lumos spectrometer data that they would like to visualize. The biomarker mode is intended for those who have spectrometer data, as well as a clinical biomarker for comparison. The app currently only supports a single biomarker for comparison.

The basic flow of the application is as follows, with some minor differences depending on the mode that is chosen: data upload, user input parameters, and graph generation. Each specific step within the flow is expanded upon below. A comprehensive tutorial page is provided that delivers in-depth instructions on the input data required and the data processing and visualization process that the application uses to compute the graphs. More information about the app can be found in the open source repository [3].

2.2 Data Upload and User Input

The web application accepts two different inputs as file uploads: text files and csv files. The text file data format that is accepted is in the form of JSON [1] objects for each LED and photodiode (PD) response; this format is intended to mimic data that is acquired from the device directly. This format is especially applicable when designing new prototypes for the Lumos device, or when there is not a preexisting data collection server. The csv file data format that is accepted contains columns for each PD spectral response, with each row corresponding to a single LED; this format is intended to mimic data that is acquired from a server that houses Lumos device data. For our use, we utilized Raproto [9] for server set-up, associated communication protocols, and data storage/retrieval. Raproto allows for the rapid adoption and utilization of wearable medical devices such as Lumos by minimizing data collection, transmission, and storage set-up typically associated with data-intensive novel wearable devices.

The user input parameters differ based on the mode; Figure 3 demonstrates these inputs for each mode. Spectrometer mode requires a spectrometer file upload and a selection of a static or animated graph. Biomarker mode simply requires a file uploaded with merged spectrometer and biomarker data. For the merged spectrometer and biomarker data, the following conditions must be satisfied: a) the sampling frequencies must be equal between the two signals; if the sampling frequencies are uneven, the data must be upsampled or downsampled, and b) the biomarker to be analyzed must occupy the last column of the input csv file.

Figure 3
Figure 3: User inputs for the two modes of operation for SpectraVue.

2.3 Graph Generation

All static plots are generated using Plotly's [5] interactive plotting tool, allowing for full user interactivity and multiple export options. The animated plots are saved as MP4 files in the assets folder of the local directory during processing, which are then displayed using Dash Player [4], a native HTML5 video renderer. Plotly was not used for this as the render time for large time-series inputs caused the application to frequently crash. To compensate, components are provided that allow interactivity with the video player, such as video play-speed.

For spectrometer mode, a static or animated graph can be generated. A static graph will compute the mean counts for each LED-PD pair and plot them as a single snapshot in time, as shown in Figure 4.

Figure 4
Figure 4: A static graph generated in spectrometer mode of SpectraVue. The values correspond to the mean values of each LED-PD pair across the entire dataset.

An animated graph will plot the input data as a time-series, where each point in time is a single, static, three-dimensional graph representing the counts for each respective LED-PD pair, as demonstrated in Figure 5. The graph is served as an HTML5 video in the application.

Figure 5
Figure 5: Animated graph output for a sample synthetic time series.

For biomarker mode, an animated graph is generated similar to that in spectrometer mode. However, a plot of the desired biomarker is also plotted adjacent to this graph, with a marker on the biomarker graph denoting where in the time-series the animation is currently displaying, as shown in Figure 6.

Figure 6
Figure 6: Biomarker mode output. Top: spectrometer graphs at ts = 1800 and ts = 4800; middle: spectrometer graphs at ts = 6000 and ts = 10200; bottom: associated biomarker graph with markers at each denoted timestamp.

All graphs provide resultant surface plots by using cubic spline interpolation [7], resulting in a smooth, distributed plane for visualization. This is preferred over a point-by-point analysis as many clinical biomarkers can be detected within a windowed spectral range. Thus, cubic interpolation allows for better comparison by providing a greater spatial spectral resolution in the resultant graph.

3 FUTURE WORK

In this section, we discuss future work planned for the application. Future work is considered as two distinct categories: the addition of functionalities to the platform, and integration into research workflows.

3.1 Planned Features

The following is a list of planned features for the near future; more may be added depending on user feedback.

  1. Additional parsers - adding parsers for different file formats such as npz or other compressed data file types; adding parsers for different data structures/formats.
  2. Data processing interactivity - a page that allows interactive data processing such as row, column, and data-point addition/deletion, and the addition of various statistical signal processing methodologies such as filtering and anomaly detection; support for PDs/LEDs that are not used in Lumos.
  3. Dataset download options - data download options for users who simply want their data processed, and will visualize it independently.
  4. Biomarker mode improvements - ability to visualize multiple biomarkers independently, or at the same time based on user input; ability to use methods such as cross-correlation and Pearson correlation to quantify comparisons in-app.
  5. Data processing improvements - currently, the application takes up to a minute for larger timeseries data-sets (> 5000 rows). We are considering ways to speed up this computation, including tools such as parallelization and caching.
  6. Mobile device adaptation - we are currently exploring ways to incorporate this analysis into the Raproto [9] workflow to facilitate real-time viewing and analysis of collected data.

3.2 Research Integration

Our primary objective is to collaborate closely with interested research groups to establish the best pathway for integrating SpectraVue into their respective research workflows. Currently, one solution we are considering is hosting the application on a dedicated physical server. This approach could offer several benefits over local execution. Firstly, it would potentially provide better performance and more storage, especially for large-scale computations or for research groups with extensive data sets. Secondly, it would promote more efficient collaboration, as data and computations could be easily accessed and shared. Lastly, it could pave the way for a standardized spectroscopic database that can be used for joint analysis of specific biomarkers across research groups.

4 CONCLUSION

Data output from wearable spectroscopic devices such as Lumos require extensive pipelines for visualization and analysis. SpectraVue aims to reduce this burden by providing a minimal and easy-to-use application, allowing rapid visualization and analysis of three-dimensional spectral time-series data. The intent of this platform is to reduce the barriers associated with using raw data from devices such as the Lumos sensor, hereby facilitating novel spectroscopic research and analysis, especially with regards to clinical biomarker development. The application has been used locally by researchers at the University of Pennsylvania, and has proven to be easy, effective, and helpful in aiding these analyses. The app, along with its associated sample data and instructions, are available online [3].

REFERENCES

  • Pierre Bourhis, Juan L Reutter, Fernando Suárez, and Domagoj Vrgoč. 2017. JSON: data model, query languages and schema specification. In Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI symposium on principles of database systems. 123–135.
  • Tsukasa Funane. 2015. Wearable near-infrared spectroscopy neuroimaging and its applications. In Annu Int Conf IEEE Eng Med Biol Soc. 4025–4028. https://doi.org/10.1109/EMBC.2015.7319277
  • Tarek Hamid. 2023. SpectraVue. https://github.com/tarek-hamid/SpectraVue.
  • Xing Hang, Alex Hsu, and Alex Johnson. 2022. Dash Player. https://github.com/plotly/dash-player.
  • Plotly Technologies Inc.2015. Collaborative data science. Montreal, QC. https://plot.ly
  • Plotly Technologies Inc.2015. Dash. https://plotly.com/dash/.
  • Sky McKinley and Megan Levine. 1998. Cubic spline interpolation. College of the Redwoods 45, 1 (1998), 1049–1060.
  • Gary E. Strangman, Vladimir Ivkovic, and Qianqian Zhang. 2018. Wearable brain imaging with multimodal physiological monitoring. Journal of Applied Physiology 124, 3 (Mar 2018), 564–572. https://doi.org/10.1152/japplphysiol.00297.2017 arXiv:https://www.ncbi.nlm.nih.gov/pubmed/28705994
  • Amanda Watson, Hyonyoung Choi, Insup Lee, and James Weimer. 2021. Raproto: An Open Source Platform for Rapid Prototyping of Wearable Medical Devices. In Proceedings of the Workshop on Medical Cyber Physical Systems and Internet of Medical Things (Nashville, Tennessee) (MCPS ’21). Association for Computing Machinery, New York, NY, USA, 1–6. https://doi.org/10.1145/3446913.3460315
  • Amanda Watson, Claire Kendell, Anush Lingamoorthy, Insup Lee, and James Weimer. 2023. Lumos: An Open-Source Device for Wearable Spectroscopy Research. Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies 6, 4 (2023), 1–24.

Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the owner/author(s).

UbiComp/ISWC '23 Adjunct, October 08–12, 2023, Cancun, Quintana Roo, Mexico

© 2023 Copyright held by the owner/author(s).
ACM ISBN 979-8-4007-0200-6/23/10.
DOI: https://doi.org/10.1145/3594739.3610709