## Figures

## Abstract

Electrodermal activities (EDA) are any electrical phxenomena observed on the skin. Skin conductance (SC), a measure of EDA, shows fluctuations due to autonomic nervous system (ANS) activation induced sweat secretion. Since it can capture psychophysiological information, there is a significant rise in the research work for tracking mental and physiological health with EDA. However, the current state-of-the-art lacks a physiologically motivated approach for real-time inference of ANS activation from EDA. Therefore, firstly, we propose a comprehensive model for the SC dynamics. The proposed model is a 3D state-space representation of the direct secretion of sweat via pore opening and diffusion followed by corresponding evaporation and reabsorption. As the input to the model, we consider a sparse signal representing the ANS activation that causes the sweat glands to produce sweat. Secondly, we derive a scalable fixed-interval smoother-based sparse recovery approach utilizing the proposed comprehensive model to infer the ANS activation enabling edge computation. We incorporate a generalized-cross-validation to tune the sparsity level. Finally, we propose an Expectation-Maximization based deconvolution approach for learning the model parameters during the ANS activation inference. For evaluation, we utilize a dataset with 26 participants, and the results show that our comprehensive state-space model can successfully describe the SC variations with high scalability, showing the feasibility of real-time applications. Results validate that our physiology-motivated state-space model can comprehensively explain the EDA and outperforms all previous approaches. Our findings introduce a whole new perspective and have a broader impact on the standard practices of EDA analysis.

## Author summary

The current state-of-the-art lacks physiology-motivated models for electrodermal activities (EDA) that have the power to comprehensively describe the variations in skin conductance (SC)–a measure of EDA. In this study, we propose a physiology-motivated state-space model to address previous challenges. On the other hand, there is also an absence of a scalable autonomic nervous system (ANS) activation inference method that simultaneously solve for the physiological system parameters. Furthermore, we develop a scalable ANS activation inference approach based on the proposed model with a goal for real-time edge computation. We utilize a dataset with 26 participants to validate the new model and the scalable method. Results demonstrate that our physiology-motivated state-space model can comprehensively explain the EDA. Our findings introduce a whole new perspective and have a broader impact on standard practices of EDA analysis.

**Citation: **Amin R, Faghih RT (2022) Physiological characterization of electrodermal activity enables scalable near real-time autonomic nervous system activation inference. PLoS Comput Biol 18(7):
e1010275.
https://doi.org/10.1371/journal.pcbi.1010275

**Editor: **Hugues Berry,
Inria, FRANCE

**Received: **September 28, 2021; **Accepted: **June 2, 2022; **Published: ** July 28, 2022

**Copyright: ** © 2022 Amin, Faghih. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

**Data Availability: **The dataset that has been used in this manuscript is already publicly available. It can be downloaded from https://zenodo.org/record/291465. The results are all reported in the manuscript itself. The code can be downloaded for use from https://github.com/computational-medicine-lab/BayesianEDA-For-Sharing.

**Funding: **This work was supported in part by NSF grant 1942585 - CAREER: MINDWATCH: Multimodal Intelligent Noninvasive brain state Decoder for Wearable AdapTive Closed loop arcHitectures, NSF grant 1755780 - CRII: CPS: Wearable-Machine Interface Architectures, and NYU start-up funds to R.T.F. The funders had no role in study design, data collection, analysis, decision to publish, or preparation of the manuscript.

**Competing interests: ** I have read the journal’s policy and the authors of this manuscript have the following competing interests: RTF and MRA are co-inventors of a patent application filed by the University of Houston based on this research.

## Introduction

The term “electrodermal activity” (EDA) refers to any electrical phenomenon on human skin [1]. EDA was discovered in the late 19th century and, since then, it has been widely used in psychophysiology as the EDA fluctuations have high correlations with the autonomic nervous system (ANS) activation. One of the most popular measures of EDA is the continuous exosomatic recording of skin conductance (SC). Due to emotional stimuli, there is a change in the psychophysiological and metabolic state of the body in order to deal with the emotional stimuli (e.g. flight or fight response). ANS may excite sweat glands based on the psychophysiological and metabolic change in the state, and the corresponding salty sweat secretions increase SC. Examination of SC measurements enables us to investigate ANS activation related to emotional arousal [2].

There are a few vital signals in the human body similar to EDA that have the potential to be measured continuously and unobtrusively using very simple instrumentation. The unobtrusive nature of the measuring techniques has led to a new era of wearable technology for continuous health monitoring. Such signals include cardiac signals (e.g. electrocardiogram (ECG) and photoplethysmogram (PPG)), skin temperature (SKT), EDA, muscle activity (e.g. electromyogram (EMG)) etc. [3, 4]. Among them, PPG and SKT have been widely integrated into consumer wearable technologies, along with reliable techniques for decoding useful information. In the past few decades, extensive research has been conducted, mainly on PPG signal analysis for wearable implementation, with the goal of continuous health monitoring. The next candidate with the greatest potential for revolutionizing wearable health monitoring is EDA [5]. However, the amount of research performed on EDA signals is relatively limited compared to cardiac signals. Although researchers have published many studies to systematically model EDA in the last two decades, there are still many fundamental characteristics of EDA being discovered today. For example, in 2020, Subramaniam *et al*. [6] have shown that the point process characterizes EDA in normal healthy participants. Therefore, further studies are required to identify the more accurate system dynamics of EDA so that critical information related to health monitoring can be obtained.

Appropriate EDA analysis has applications in a wide range of fields such as mental disorders, pain, cognitive stress tracking, wakefulness, etc. As different physiological signals, including EDA, contain information about human emotional arousal, they have potential applications in the field of mental health. For example, preventing death from mental disorders with regular tracking could be one potential application, as Walker *et al*. [7] reported that a large portion of deaths worldwide are attributable to mental health-related disorders. A meta-analysis shows that mental disorders are a major risk factor for suicide [8]. Suicide is one of the leading causes of death in the United States in the year 2017 [9] and the cost related to suicide alone in the United States were more than $90 billion in 2013 [10]. Studies have recommended [10] community-based immediate psychiatric services, including telepsychiatric support for reducing suicide-related costs which require continuous monitoring. Augmenting EDA with other physiological signals for time-to-time monitoring of critical patterns of emotional regulation could potentially help preventing psychiatric disorders [11].

Another possible potential application is in treating diabetic neuropathy. Diabetic neuropathy refers to small nerve damage caused by prolonged exposure to high levels of blood glucose concentration [12]. As a result, small nerves along with the sudomotor nerves in the legs, feet, and hands that are responsible for transmitting ANS activation are prone to neuropathy [12]. As confirmed by numerous studies in [13–15], damages in small nerves, including the sudomotor nerves may lead to abnormal EDA variations. Furthermore, it is well known in clinical diagnostics that the development of anomalies in sweat secretions may be attributed to forms of disorders, such as hypohidrosis and anhidrosis [16]. Moreover, such disorders may indicate diseases like diabetes mellitus [16]. Clinical investigations of abnormalities in the SC recordings can be pivotal for the early detection of such diseases.

Because of its wide range of applicability, accurate modeling of system-theoretic understanding is a prerequisite. In 1997, Lim et al. [17] proposed a heuristic sigmoid-exponential model to represent the rise and decay characteristics of the SCR shape. Instead of a general approach, they had to consider four different configurations of the proposed model for four different cases. Later in 2005, Alexander et al. [18] proposed a second-order differential equation for defining the SC fluctuations, the solution of which is a bi-exponential function representing the rise and decay of the SCR shape. They assumed that SC is single-phasic and, more specifically, that all fluctuations can be defined with the second-order differential equation. However, eventually researchers have realized the bi-phasic nature of EDA fluctuations, meaning there are two different components in EDA that vary in two different rates [19–24]. Bach *et al*. [25] have used a low-pass filter to separate slow varying component and then investigated the fast varying component as the output of a finite linear time-invariant (LTI) filter. Benedek *et al*. [19, 26] have suggested bi-exponential functions, namely Bateman functions, to describe the slow varying components with large decay time and the fast varying component with smaller decay times. However, this model cannot explain both components together. In a similar time, Bach *et al*. [20] reported that bi-exponential functions provided better fit than other candidates while modeling the fast varying component after removing the slow varying component with low-pass filter. Nevertheless, the FIR filter-based separation of the slow and fast varying components has limitations as pointed out in our previous work [24].

In our previous studies [23, 24, 27–29], we have developed deconvolution approaches in which we investigated previously known mathematical models for EDA dynamics. In these studies, we have utilized the SC modeling approach in [21], where the authors have modeled the slow varying component of EDA with a linear combination of a few arbitrary cubic spline basis functions. Although such a model can provide a good fit to the data, it lacks a reasonable physiological justification, and the corresponding coefficients of the obtained cubic-spline functions obtained do not have an interpretation. Furthermore, the cubic-spline basis function based model may overfit to the data and provide a solution that is not physiologically plausible. In addition, the lack of a complete state-space model makes it difficult to design scalable fixed-interval smoother (FIS) based inference approaches for recovery of ANS activation. Although similar approaches have been developed for calcium oscillation deconvolution and EEG sleep spindle detection [30], it is difficult to develop such an approach for EDA with the models currently available. During our development of deconvolution approaches, we realized that there is a need for a potential improvement in the current mathematical models for describing EDA dynamics as well as the current deconvolution practices to obtain a systematic and reliable approach with the feasibility of real-time application.

Therefore, in this study, we propose a unified and comprehensive state-space model to describe both the slow and fast varying components of EDA. We first start with a more general and physiologically interpretable nonlinear model and then derive a simpler linear state-space one. Additionally, our proposed model enables us to derive an FIS based novel scalable sparse deconvolution approach which was not previously possible because of the absence of a comprehensive state-space model for the potential of real-time inference. For obtaining our novel approach, we extended the scalable sparse deconvolution approach for calcium and EEG sleep spindle deconvolution proposed by Kazemipour et al. [30], which was developed for a subset of state-space equations considering the input matrix as an identity matrix. We generalized this for the state-space models with any input matrix and apply it for our proposed SC model. Moreover, for estimating the state-space model parameters, we utilize the previously known physiological priors similar to [24]. Furthermore, we employ generalized-cross-validation for balancing between the sparsity level of the ANS activation and the model fit for systematic reduction of the measurement noise. We compare the performance of our approach with previous deconvolution approaches. Furthermore, we show the scalability of our approach, illustrating the feasibility of devising real-time edge computation with our approach.

## Materials and methods

### Dataset description

In this study, we analyze the SC recordings where participants experience multiple auditory stimuli (loud sounds) during the experiment [31]. The experiment was designed to investigate event-related SC responses (SCRs) [32]. Each participants received multiple auditory stimuli. Each auditory stimulus is a single white noise burst of 1s length with a 10 ms ramp and 85 dB power. The participants were instructed to press a foot pedal upon hearing a stimulus. The dataset contains recordings from thirteen female and thirteen male participants. The partcipants are all healthy and unmedicated with age 24.4+/-4.9 years. For each of the 26 participants, the datasets include three channels of SC recordings from three different locations. We use the SC recordings from the thenar/hypothenar of the nondominant hand for all datasets in this study. The details regarding the experiment are provided in [32]. We pre-process all recordings with an approach similar to [28] and resample the SC recordings to 4 Hz for our analysis.

### Proposed physiological model

We propose our model based on the *poral valve model* by Edelberg [33]. For the sake of discussion, let’s assume the sweat ducts are initially empty and in response to the received impulsive ANS activation, secretions from the sweat glands start to fill the sweat ducts. As the amount of sweat in the ducts increases, there is an increase in the hydraulic pressure inside. The pressure build-up gives rise to the increasing diffusion into the stratum corneum and the deeper stratum corneum area. This results in a slight rise in the SC level. If the pressure exceeds a certain threshold, the pores of the sweat ducts open for sweat secretion. This way, a fraction of the sweat is secreted directly by the pore opening. The secreted sweat and the connected sweat content in the ducts both contributes to the conductance. Therefore, there is a sharp rise in the SC level. Here, direct secretion refer to the secretion of sweat via the pore to the surface of the skin. On the other hand, sweat secretion via diffusion refers to hydration of stratum corneum when sweat slowly travels via the sweat duct wall. As the direct secretion and the diffusion reduces the hydraulic pressure and the pressure goes below a certain threshold, the pore collapse separates the sweat contents in the ducts and prevents them from contributing to the conductance. Consequently, a faster decay in SC level is observed. We define it as the faster re-absorption resulting in the faster decay time in SC. The remaining secreted fraction of the sweat in the stratum corneum is diffused into the deeper dermis and cleared away from the periductal area by a slow re-absorption process. Along with re-absorption, a fraction in the reduction of SC is because of the evaporation from the surface. These steps will lead to SC level to decay slowly. A visual illustration of the steps for the poral valve model is provided in Fig 1A. Fig 1B shows a cross section of the skin illustrating regions involved in different steps of SCR generation. With these speculations, we propose the following nonlinear state-space model:
(1)
(2)
(3)
where *x*_{1}(*t*), *x*_{2}(*t*), and *x*_{3}(*t*) respectively denote the states corresponding to the amount of sweat in the sweat ducts, in the ducts but electrically conducted to the surface due to the pore opening (contributing to the SC level), and diffused in the stratum corneum according to the hypothesis in the poral valve model proposed by Edelberg [33]. The states *x*_{2}(*t*) and *x*_{3}(*t*) are contributing to the rise in the SC level. *τ*_{p} denotes the faster decay time due to fast re-absorption (related to the pore collapse). *τ*_{d} represents the slow decay time related to the elimination from stratum corneum partially by re-absorption, diffusion in the deeper stratum corneum, and evaporation. We assume clearance rate from the sweat duct is equal to the sweat secretion rate to the surface and the adjacent skin tissue are. *τ*_{r} denotes the rise time of SC, (effectively the clearance time of the sweat from the ducts). One should note that the state-space model does not assume the duct is initially empty. Here, Eq 1 denotes the mechanism of ANS activation to the Compartment I for sweat production and corresponding sweat transportation towards Compartment II and III in Fig 1C. Eq 2 denotes the increase in the sweat content in Compartment II and corresponding fast re-absorption process in the model in Fig 1C. The location and the direction of the direct sweat secretion via pore opening (SCR generation step 3 in green arrow) and the corresponding fast re-absorption (SCR generation step 4 in red arrow) are denoted in Fig 1B and 1C. Similarly, Eq 3 denotes the increase in the sweat content in Compartment III and corresponding slow elimination process in the model in Fig 1C. The location and the direction of the sweat secretion via diffusion (SCR generation step 2 in purple arrow) and the corresponding fast re-absorption (SCR generation step 5 in magenta arrow) are denoted in Fig 1B and 1C.

(A) A step by step illustration of the *poral valve model* proposed by Edelberg [33]. (B) An illustration of the cross section of the skin segment and corresponding different regions contributing to the SCR generation process based on *poral valve model*. (C) A three compartment pharmacokinetic realization of the *poral valve model*. The arrows with different colors in panel B and C correspond to the secretion and clearance of sweat contents in different steps denoted by the associated step numbers as represented in panel A.

The system input *u*(*t*) represents the ANS activation. To keep the definition simple, we assume that the ANS activation occurs during the integer multiple of the sampling period. Let *T*_{s} be the sampling period. Researchers reported that a single neural impulse from ANS is responsible for a single SC response [21, 22, 34–36]. Moreover, the sparsity constraint on *u* has been proven to be an appropriate prior in our previously developed algorithms [23, 24, 27–29, 37]. With the sparsity assumption, we represent the ANS activation as where *u*_{k} is the amplitude of the impulse during the ANS activation at time *kT*_{s}. *u*_{k} is zero if there is no impulse in the stimuli. Moreover, *η*_{p}(*x*_{1}(*t*)) and *η*_{d}(*x*_{1}(*t*)) are two functions that determine the fraction of sweat that is secreted by direct pore opening and diffusion, respectively. We assume *η*_{p}(*x*_{1}(*t*)) and *η*_{p}(*x*_{1}(*t*)) denote the nonlinearity in the pore opening operation. The nonlinearity of the pore opening is similar to the switching operation (on/off) and analogous to how a neuron works, i.e., in integrate-and-fire manner as pointed out in [6]. Therefore, we propose to model these nonlinearities with sigmoid functions similar to the artificial neurons as follows:
where *S*(*x*) = (1 + *e*^{−x})^{−1} represents the sigmoid function. Although we assume it as an integrate-and-fire operation, there is a difference, i.e., even if the pores do not open, the sweat secretion will still be carried out by the diffusion process via duct wall with relatively slower. Here, the nonlinear function *η*_{d}(*x*_{1}(*t*)) represents the the fraction of sweat secreted via diffusion for a given duct pressure represented by *x*_{1}(*t*). Similarly, *η*_{p}(*x*_{1}(*t*)) represents the change in the fraction of sweat secreted via pore opening for a given duct pressure represented by *x*_{1}(*t*). We assume thatthe amount of absorbed sweat in the stratum corneum and epidermis that contribute to the SC level due to diffusion process is denoted by *x*_{3}(*t*). The sweat content in the ducts and electrically conducted to the surface due to the pore opening is denoted by *x*_{2}(*t*) contribute to the SC level. Therefore, the observation equation denoting resultant SC is as follows,
where *y*(*t*) and *ν*(*t*) represent overall SC measurement and the noise signal, respectively. Equivalent to previous approaches, the phasic and the tonic components can be written as follows,
where *y*_{P}(*t*) and *y*_{T}(*t*) represents the phasic and the tonic components, respectively.

Apparently, the proposed model is highly nonlinear and it is very difficult to derive a practical deconvolution approach that runs in edge devices with this model. For the simplification, we assume that the fraction of sweat secretion that happens via pore opening is always constant. Therefore, the simplified linear version of the model is obtained by the assumption that *η*_{p} and *η*_{d} is constant w.r.t *x*_{1}(*t*) (*α* = 0) s.t. *η*_{d} = 1 − *η*_{p} = *η*. Here, *η* is a constant and it represents the fraction of sweat that is secreted by diffusion process, i.e., *η* ∈ [0, 1]. This simplification makes the model linear and more suitable for scalable edge computation. Now, the simplified model can be thought of as a three compartment pharmacokinetic model as shown in Fig 1C. To represent it in vector matrix form we define , , , . Therefore, the continuous state-space model in matrix form is as follows:

#### Discretization.

Let *y*_{k} be the observed SC at time instance *kT*_{s}. We can write,
(4)
where *ν*_{k} ∀ *k* represent the noise and are modelled as independent and identically distributed (i.i.d) zero mean Gaussian random variable, i.e., . We derive the discrete equivalent of the system, assuming that the input and the states are constant over *T*_{s}. The discrete version of the neural stimuli can be written as a vector ** u** = [

*u*

_{1}

*u*

_{2}⋯

*u*

_{K}]

^{⊤}that represents the entire neural stimuli over the duration of SC data. Let , , and

**=**

*C*

*C*_{c}to write the discrete state-space form as: (5) where , ,

*u*

_{k},

*ν*

_{k}denote the state vector, the observation, ANS activation, and the measurement error in discrete domain. The corresponding discretized phasic and tonic components can be written as follows, where and . Here,

*y*

_{P,k}and

*y*

_{T,k}represents the discretized version of the phasic and the tonic components, respectively.

### Physiological priors and constraints

The proposed model has many unknown parameters, and the number of measurements is relatively small. Therefore, the problem has many degrees of freedom. It is customary to enforce appropriate physiologically motivated priors on the model parameters. Otherwise, in the worst cases scenarios, the solution may not stay within the physiological boundaries and may lead to over-fitting [38]. Therefore, we incorporated physiologically motivated priors on the system model similar to [24, 39]. We assume that the individual model parameters are Gaussian distributed with some mean and variance similar to [24]. We use this information as a prior in the estimation step.

Further, we also consider equality and inequality constraints on the system parameters. First of all, we constraint all the physiological parameters are non-negative. We select a lower bound for *τ*_{r} of 0.2 seconds based on the result distribution obtained in our previous study [24]. Furthermore, we set *τ*_{p} > *β*_{1}*τ*_{r} and *τ*_{d} > *β*_{2}*τ*_{p} similar to our previous work [23, 24, 28]. However, the values of *β*_{1} and *β*_{2} are unknown for the proposed model. Therefore, we select the values of *β*_{1} and *β*_{2} by manually by investigating the results by trials and errors such that the multiple correlation coefficients for all participants are *R*^{2} > 0.98. First, we try to run the algorithm (described in the next section) without any constraint on *τ*_{r}, *τ*_{p}, *τ*_{d} and *η*. However, most of the case algorithm converges in a solution where the model fit is very poor and has a very small multiple correlation coefficient. And in most cases, *η* was convergent to 0 or 1. This is an indication of having a model with a very high degree of freedom. Therefore, we first decided to fix *η* = 0.5 assuming that 50% contributions of each type of secretion (i.e., via pore opening and via diffusion) reduce the complexity. Second, we decide to set as *τ*_{p} > 2*τ*_{r} as this constraint can be inferred from the previous distribution of the rise time and the decay time of the phasic component [24]. The reader should note that the estimated phasic decay time is at least 3 to 4 times the estimated rise time in [24]. Therefore, *β*_{1} = 2 should be a fairly conservative choice. Finally, we decide to find the constraint for *τ*_{d}. As among all the time constants, *τ*_{d} is the slowest one, we consider the constraint with *τ*_{d} > *β*_{2}*τ*_{p} for different *β*_{2} ≥ 1 and run the algorithm and try to see which value provide better goodness of fit for all 26 participants in terms of *R*^{2}. We start with *β*_{2} = 1 and increment it by 1. We stop once all the participants (except Male Participant 12 as there is no fluctuation) show above 0.98 of *R*^{2}. One should note that other configurations might also work. For example, if someone decides to start with a value of *η* other than 0.5, they might have to follow a similar procedure to find the new constraints. This suggests that there is a scope of further future investigation of the current method.

### Estimation

We wish to estimate the parameter vector and unknown ANS activation *u*_{k} given the SC measurement *y*_{k} ∀ *k* ∈ {0, 1, ⋯, *K* − 1}. One straighforward way is to solve the following optimization problem,
(6)
where (*x*_{k} − *A**x*_{k−1}) = *B**u*_{k}. If we consider the first term in Eq 6, i.e., the *l*_{1}-norm of (*x*_{k} − *A**x*_{k−1}) as the negative log-likelihood, taking the exponential of the negative of the gives us the Laplace distribution of *B**u*_{k} = (*x*_{k} − *A* *x*_{k−1}) with parameter . The second term in Eq 6 represents the least squares error between the observation *y*_{k} and the prediction *C**x*_{k} with a Gaussian observation error assumption. The final term represents the negative loglikelihood of the Gaussian priors on the system parameters with *ρ*_{j}, , and represents the regularization parameters, the mean, and variance for the Gaussian priors, respectively ∀*j* ∈ {0, 1, 2, ⋯, *J* − 1}. In this case, *J* = 3. Therefore, Eq 6 can be considered as the maximum *a posterior* (MAP) estimator as pointed out in [30]. In general, the problem formulation in Eq 6 is solved for *u*_{k} by taking the derivative of Eq 6 with respect *u*_{k} and setting it zero. This is particularly done using iteratively re-weighted least square (IRLS) approach. The sparse recovery with the direct analytical solution of the state-space model requires a matrix inversion of a *K* × *K* matrix as shown in our previous works [23, 24, 27]. This step works as the bottle neck of the approach. In this study, we solve the very same problem with iterative re-weighted lease squares approach implemented using FIS. The states *x*_{k}, the ANS activation *u*_{k} and the matrices describing system dynamics ** A** and

**can be estimated in an expectation-maximization (EM) approach.**

*B*Given the probabilistic model that generates a set of observed data *Y* = {*y*_{k}}∀*k* ∈ {0, 1, ⋯, *K* − 1} and a vector of unknown parameters ** θ**, we can write,

*p*(

*Y*,

*θ*) =

*p*(

*Y*|

*θ*)

*p*(

*θ*). The following maximum log-likelihood estimation problem can be solved in order to estimate the

*θ*:

Now lets introduce a set of hidden unknown states *X* = {*x*_{k}, *u*_{k}} ∀ *k* having a joint probability distribution *p*(*Y*, *X*; *θ*). We can re-write the maximum likelihood estimation as the following marginal likelihood function of *p*(*Y*, *X*; *θ*):
(7)

We defined the joint log-likelihood function for *Y*, *X*, and ** θ** as follows:
(8)
where the and denotes the probability density functions corresponding to

*ν*

_{k}=

*y*

_{k}−

*C**x*_{k}and

*B**u*

_{k}=

*x*_{k}−

*A*

*x*_{k−1}, respectively. Here, only the term depends on

*θ*.

The original problem can be defined as the following expectation maximization (EM) approach, (9)

As it is expressed in Eq 9, the unknowns can be estimated by iteratively maximizing the expectation of the joint log-likelihood in Eq 8 as shown in S1 Appendix.

#### E-step (sparse recovery).

Let’s assume that we know the current estimate of model parameters *θ*^{(i−1)} from the (*i* − 1)^{th} iteration of EM. We calculate the corresponding state matrices *A*^{(i−1)} and *B*^{(i−1)}. At *i*^{th} iteration of EM, given the sequence of observations *y*_{k} ∈ *Y* and given probability distribution *q*(*X*) = *p*(*X*|*Y*, *θ*^{(i−1)}), we wish to estimate the expectation of and . We choose the probability distribution for *u*_{k} such that it enforces sparsity. Kazemipour et al. [30] proposed to use Laplace distributed with parameter for sparsity of the innovation terms in the state transition equations. In this study, we consider a broader family of distributions, namely, generalized Gaussian distribution for *u*_{k} so that distribution parameters can be selected to obtain a range of distributions such as Gaussian and Laplace distribution. In contrast to [30] where the input matrix is considered as an identity one, we assume that denote the scalar (or column vector) ANS activation and *B*^{(i−1)} works as a direction vector (or matrix) of innovation in the state transition equation. We consider is generalized Gaussian distributed, i.e.,
where *γ*^{(i)} and *p* defines the shape of the generalized Gaussian distribution. *p*(*u*_{k}|*γ*^{(i)}, *p*) can also be written in terms of *x*_{k} with multi-variate generalized Gaussian distribution as follows.
where λ^{(i)} represents the new parameter related to the new random variable to obtain the equivalent pdf (). The sparsity constraint is imposed on for 0 < *p* < 2. However, the closed form equations for FIS do not exist for generalized Gaussian distribution where *p* ≠ 2, although they are the prerequisite for scalable edge computation of the sparse recovery. Therefore, we approximate the generalized Gaussian distribution with iterative re-weighted Gaussian distributions for the closed form derivation of the forward filter and backward smoother equations. For example, if *p* = 1, the generalized Gaussian distribution becomes Laplace distribution as shown in [30]. Therefore, we approximate the Laplace distribution of with iterative re-weighted Gaussian distributions, i.e., if at *r*^{th} re-weighting step the state estimation is , the Laplace pdf can be approximated with Gaussian pdf as follows:
where λ^{(i, r)} is the regularization at *r*^{th} re-weighting step. is the co-variance matrix at *r*^{th} re-weighting step at *k*^{th} time point and we define it defined as follows:

Here, *ϵ* is a value close to zero for the matrix perturbation to achieve numerical stability. We select *ϵ* = 10^{−5} for the numerical stability. Unlike the conventional IRLS approach where the covariance of the Gaussian approximation is taken to be diagonal, here the current definition takes the square root of the entire matrix. The perturbations enable us to obtain feasible inverse during FIS prediction and update equations as is always singular. The generalized approximation is performed by implementing *ℓ*_{p}-norm with Gaussian distribution approximation of generalized Gaussian family as follows where 0 < *p* < 2,
(10)

Similar to the previous case with square root, here the power has been taken on the whole matrix. With this approximation, we perform Kalman filtering and backward smoothing to obtain the expectation of the state variables ’s and corresponding covariance matrices. Constraining the corresponding innovation in the state equation to be along the direction of the vector ** B**, the expected

*u*

_{k}is given as follows at

*r*

^{th}re-weighting step: (11) where

*u*

_{th}is the selected minimum amplitude for ANS activation. Here, we select

*u*

_{th}= 0.03

*μS*/

*s*for the initialization step and

*u*

_{th}= 0.25

*μS*/

*s*during the main step. Here, a relatively conservative value of

*u*

_{th}has been selected in the initialization step to avoid excessive pruning before having good initialization of a other parameters. The selection has been done manually by trial and error such that the results for all participants that reduces the number of detected spikes while keeping the multiple correlation coefficient

*R*

^{2}> 0.95. During this process, the number of detected detected spikes that visually does not correspond to any SCR is minimized. The evaluation of the obtained spikes has been evaluated by visual inspection (verified by two different viewers) similar to apporach in [6]. The criteria of selecting

*u*

_{th}is chosen to obtain a reasonable goodness-of-fit define by

*R*

^{2}while avoiding any over-fitting. The use of threshold

*u*

_{th}enables us to obtain a constrained solution of

*u*

_{k}without implementing actual constrained Kalman filtering and backward smoothing. As is scalar in the above optimization formulation, the solution can be written directly as follows: (12)

This allows us to project the error vector along the direction of *B*^{(i−1)} vector based on least square error with a minimum threshold. This is an approximation to make sure that the solution is consistent with the assumptions of the state-space model. In this study, we select *p* = 0.5 for *l*_{p}-norm similar to our previous studies in [23, 24, 27–29].

#### Adjust sparsity level by choosing *γ*.

In the initialization phase, we choose a scheme for selecting λ similar to IRLS algorithm *FOCUSS*+ algorithm in [40]. At *r*^{th} re-weighting iteration of E-step, the heuristic estimation of λ works as follows:
(13)

Then, we set . Similarly, in the main EM phase, we use generalized-cross-validation (GCV) technique similar to the GCV-FOCUSS+ technique [41]. We modified the GCV technique to obtain scalability. To achieve this, we segment our observations with a window size of *M*_{gcv} samples and apply GCV to obtain a λ for each window. For *n*^{th} segment, the discretized vector form solution can be provided as, where , *x*_{n+1}, represents the observation vector, the first state and the ANS activation in the *n*^{th} segment, respectively. *F*_{n} and *D*_{n} are the matrices for the complete discretized vector solution for *n*^{th} block and can be defined as, and where *F*_{n,k} = *C**A*^{k} and . *M*_{gcv} = 100 worked well for our study.

For *n*^{th} segment, we obtain λ_{n} using the following optimization formulation based on singular value decomposition (SVD) for GCV proposed in [41]:
(14)
where with , and with and **Σ** = diag{*κ*_{j}}; ** U** and

**are unitary matrices and**

*V**κ*

_{i}’s are the singular values of . We estimate

*γ*

_{n}∀

*n*and take the median. Finally, we set .

Usually, the re-weighting in E-step converges within a very small number of iterations. We perform the re-weighting in E-step for *r* = 0, 1, 2, ⋯, 5. After finishing all the re-weighting iterations in the E-step, we obtain the following estimations: and . Here, and represents the estimates of and , respectively. Here, we drop *r* to represent the final E-step estimations.

#### M-step (physiological parameter estimation).

The M-step at *i*^{th} iteration can be defined as the following simplified constrained optimization problem utilizing Eq 6 and EM derivation,
(15)
where , , , and determines the constraints on *θ*. The equality constraints ensures the sum of *η*_{p} and *η*_{d} are equal to 1. To incorporate estimated from the E-step, we re-write the Eq 15. The modified optimization formulation is as follows,
(16)

After some algebraic manipulation and assumption that and are statistically independent ∀*k*, we obtain the following optimization formulation by removing the constant terms with respect to ** θ**.
(17)

The overall approach can be divided into two phases. In the first phase, we perform initialization with a fixed at each iteration and with heuristic refinement of λ^{(i, r)}. A detailed description of heuristic refinement is provided in S2 Appendix. *u*_{α} = 1 worked well for our study. In the main EM-phase, we update , i.e. with the values obtained in the previous re-weighting iteration. In E-steps of both phases, we perform a heuristic refinement of *u*_{k}. After finishing all re-weighting iterations in the E-step, we obtain the following estimations: and . The expected values are plugged into the M-step optimization formulation in 17. The constrained optimization problem in 17 is solved using the interior-point method. The overall algorithm for the initialization and the main EM-phase is provided in Algorithm 1.

### Selection of noise variance *σ*_{ν} and it’s relation with λ

The presence of noise may lead to inaccurate estimates of ANS activations. The regularization parameter λ related to sparsity dictates the level sparsity of *u*_{k}, choice of higher value of λ leads to more sparse solution and vice versa. On the other hand, if the of guess of the observation noise variance is higher, the estimation deconvolution tend to fit more to the state equation itself without having much innovation term (i.e. smaller *B**u*_{k}) than the current observation. For regular FIS, there is a always a trade-off between process noise and the observation noise. If the observation noise is high then the process noise usually tend be very low during the estimation. In case of IRLS-based FIS for sparse recovery, the process noise is represented with the innovation term, i.e. the ANS activation *u*_{k}. Therefore, if the observation noise variance *σ*^{2} is selected to be smaller, the innovation *u*_{k} will have more zeros ∀*k*. In other words, higher value of observation noise variance *σ*^{2} leads to a more sparse estimation of *u*_{k}. Therefore, although we have incorporated a GCV based approach for selecting λ that tunes the sparsity level of *u*_{k}, the noise filtration also depends on the selected observation noise variance, . For the experimental study, we have selected . This value is working well along with the GCV for balancing between discarding the noise and capturing the process. We have kept the value of same for the simulated study. Our results show that it is capturing more spikes than the ground truth for heavy noise level. As pointed out in [30], increasing the noise variance will lead to a much smoother estimate with a lower number of spikes. For most of the cases, GCV could discard most of the spikes related to noise. Because, the corresponding selected are within the reasonable range for GCV to obtain a balance. Therefore, for GCV to balance the noise spike, a reasonable choice of is required. However, for some cases it is challenging to find such a reasonable value for GCV. Higher values of may result in some of the SCRs undetected. Therefore, we select a relatively small value of such that none of the SCRs remain undetected. As most of the detected noise spikes are relatively smaller than the spikes related to the SCRs, application tailored post-processing (e.g. hard/soft thresholding) can remove most of the noise spikes.

**Algorithm 1**: bayesianEDA

**Input**: *y*_{k} ∀*k*

**Output**: *u*_{k} ∀*k* and *θ*

**1 Initialization Phase**: Initialize .

**2 for** *i* = 1, 2, 3, ⋯, 30 **do**

**3** Set

**4** **E-Step**:

**5** With , calculate *A*^{(i−1)} and *B*^{(i−1)}

**6** **Iterative re-weighting**:

**7** **for** *r* = 1, 2, 3, ⋯, 10 **do**

**8** Estimate λ^{(i,r)} using 13.

**9** Perform heuristic refinement of .

**10** Set .

**11** Estimate and using FIS.

**12** Set .

**13** **end**

**14** **M-Step**: Set and and solve the optimization problem in Eq 17 to obtain *θ*^{(i)}.

**15 end**

**16 Main EM Phase**: **while** until convergence **do**

**17** Set *i* = *i* + 1

**18** Set

**19** **E-Step**:

**20** With , calculate *A*^{(i−1)} and *B*^{(i−1)}.

**21** **Iterative re-weighting**:

**22** **for** *r* = 1, 2, 3, ⋯, 10 **do**

**23** Estimate λ^{(i, r)} using the modified GCV technique.

**24** Perform heuristic refinement of .

**25** Set .

**26** Estimate and using FIS.

**27** Set .

**28** **end**

**29** **M-Step**: Set and and solve the optimization problem in Eq 17 to obtain obtain .

**30 end**

#### Consideration of non-convexity.

The complete data log-likelihood that is optimized by the EM approach might suffer from non-convexity and there is a potential risk that the solution may end up in different locations for different initial values. To test that, we run our EM approach for multiple random initializations of the physiological system parameters. Based on the simulated and the experimental datasets we have analyzed, we have observed that the solution for a given SC signal always converges to one location no matter what initial value has been selected. Therefore, we decided to only run our approach for one random initialization of the physiological system parameters in this study, unlike our previous approaches where we have used multiple random initializations and selected the solution that satisfies the selection criteria [23, 24, 28].

## Results

We use the proposed approach to deconvolve the SC measurements from 26 participants. The deconvolution approach provides the estimates of the underlying ANS activation *u*(*t*), rise time (*τ*_{r}), faster decay time (*τ*_{p}), and slow decay time (*τ*_{d}). We have considered the signal segment from 150 to 350 seconds for the analysis on the experimental data. Figures from the deconvolution results for one female and one male participant are provided in Fig 2. The figures from the deconvolution results for all 13 female and 13 male participants are provided in S1–S4 Figs. These figures depict the successful estimation of the sparse ANS activation due to auditory stimulation.

In each of the panels, i) the top sub-panel shows the experimental SC signal (red stars), the reconstructed SC signal (black curve), the estimated tonic component (green curve), and the timings of the auditory stimulations (gray vertical lines); ii) the bottom sub-panel shows the estimated phasic component (blue curve), estimated ANS activation timings and amplitudes (black vertical lines) and the timings of the auditory stimuli (gray vertical lines).

The estimated rise time (*τ*_{r}), fast decay time *τ*_{p}, slow decay time *τ*_{d}, number of pulses (||**u**||_{0}), and multiple correlation coefficient (*R*^{2}) are provided in Table 1. Fig 3 shows the histogram of the estimated state-space model parameters from all 26 participants. The estimated means of the parameters among the 26 participants are *μ*_{r} = 2.0040, *μ*_{p} = 5.4545, and *μ*_{d} = 81.8175 seconds for rise times, fast decay time, and slow decay times, respectively. Corresponding standard deviations are *σ*_{r} = 0.8675, *σ*_{p} = 1.9258, and *σ*_{d} = 28.8874 seconds, respectively. The calculated multiple correlation coefficients (*R*^{2}) are greater than 0.98 for all participants except for Male Participant 12 (*R*^{2} for Male Participant 12 is 0.8352). This suggests that the proposed model can successfully explain the variations in SC recording.

In top sub-panel in the red and green bar plots correspond to the histogram plots of the estimated rise time *τ*_{r} and decay time *τ*_{d}, respectively. Red, green and blue vertical lines correspond to the locations of the means *μ*_{r}, *μ*_{p} and *μ*_{d} of the corresponding histograms, respectively.

For further evaluating the performance of the proposed algorithm on experimental data, we utilize it’s ability of separating a high-arousal condition (with larger ANS activation amplitudes) from a low-arousal condition (with smaller ANS activation amplitudes), inspired by the work commonly done in the PsPM framework [42]. We utilize the estimated ANS activation ** u**(

*t*) in distinguishing between SCRs that are related to and not related to loud sound events. We label all the impulses in estimated

**that have been detected within 5 seconds after a loud sound event as the positive class and other impulses as the negative class. We consider the amplitudes of the impulses as the classification scores within the subjects for obtaining the receiver operating characteristic (ROC) curves [43, 44]. The estimated area under the ROC curves (AUC) for all participants ranges from 0.6600 to 1 with a median of 0.9380 and a mean of 0.8960. We individually normalized the estimated**

*u***for all participant and combined all**

*u***in one vector to obtain an overall ROC. The estimated overall AUC is 0.8196. We compare our proposed bayesianEDA approach with LedaLab-CDA [19], LedaLab-DDA [26], cvxEDA [21], sparsEDA [34], PsPM-MP [45], PsPM-DCM [20], and our spline based approach [24]. The ROC curves are for each of the approaches shown in Fig 4A. The corresponding overall AUC’s are shown in Fig 4B. We further count the number of auditory stimulations for which no SCRs were detected, we name them as number of undetected auditory stimulation. The number of undetected auditory stimulation for each approaches is shown in Fig 4C.**

*u*(A) The overall ROC curve related to the discrimination power between event-related vs non-event-related SCRs combining all the normalized **u** from each of the individual participants. (B) Corresponding AUC of the ROC curves. (C) Total number of the undetected auditory stimulation impulses within 26 participants.

To further investigate the efficacy of our approach, we use the reconstructed signal from our experimental study and add Gaussian noise to simulate data for all 26 participants similar to the previous works in [23, 24, 28, 46, 47]. We consider the results from the experimental study as the ground truths to compare with the estimation from the simulated study. The proposed approach successfully estimates the ANS activation along with the physiological model parameters. All the multiple correlation coefficients (*R*^{2}) are greater than 0.98 for simulated data with 25 dB noise level is 0.9872. Estimated system parameters (, and ), estimation errors, and the multiple correlation coefficients (*R*^{2}) for the results for all the simulated data with 25 dB SNR are provided in Table 2. Further, we also perform the same analysis for 35 dB SNR noise level. The deconvolution result figures related to both 25 dB and 35 dB SNR noise level are also provided in Figs 5 and 6 for two participants for each case. All the other simulation results with Gaussian noise are provided in S5–S12 Figs. Furthermore, we performed similar deconvolution study with pink noise with 25 dB SNR for the signal which show similar results as for the case of Gaussian noise showing the robustness to the model mismatch. The corresponding figures are provided in S13–S16 Figs.

In each of the panels, i) the top sub-panel shows the ground truth for SC signal (red stars), the reconstructed SC signal (black solid curve), the estimated tonic component (green solid curve), and ground truth for the ANS activation (gray vertical lines); ii) the bottom sub-panel shows the estimated phasic component (blue solid curve), estimated ANS activation timings and amplitudes (black vertical lines) and the ground truth ANS activation (gray vertical lines).

In each of the panels, i) the top sub-panel shows the ground truth for SC signal (red stars), the reconstructed SC signal (black solid curve), the estimated tonic component (green solid curve), and ground truth for the ANS activation (gray vertical lines); ii) the bottom sub-panel shows the estimated phasic component (blue solid curve), estimated ANS activation timings and amplitudes (black vertical lines) and the ground truth ANS activation (gray vertical lines).

We add noise with different noise power to investigate how the proposed approach performs in terms of estimating the unknowns and the reconstructed signal. We add Gaussian noise with different energy levels to the reconstructed SC signals from the experimental study for the 26 participants and perform deconvolution to estimate unknowns with the proposed approach. We calculate the average estimation errors of the unknowns for all participants at different noise levels. Figs 7 and 8 show how the average estimation error changes as the noise level increases. Similarly, Fig 9 shows how the reconstruction errors change at different noise levels.

Red squares, green pentagram, and blue triangles connected with solid lines denote the average percentage errors for the estimated rise times, fast decay times, and slow decay time from simulated data with SNR levels. The SNR is provided with respect to the phasic component.

Black diamonds with the dashed lines denotes the average amplitude error of the neural stimuli from estimated data with different noise levels. We have defined the average amplitude error as , where and ** u** represent the estimated and the ground truth neural stimuli, respectively. The data is simulated using the obtained results from the all experimental data in [31]. The SNR is given with respect to the phasic component.

Green, blue and red dashed lines denote the RMSE for the reconstructed tonic component, phasic component and overall SC data in different noise levels. The data is simulated using the obtained results from the all experimental data in [31]. As noise is added to the phasic component prior to addition of tonic component, the SNR is given with respect to the phasic component.

To empirically investigate the time complexity of the approach, we utilize the experimental data with different durations and perform deconvolution using our approach. We measure the run-time for each of the deconvolution. Fig 10 shows the distributions of the run-times in different signal lengths. According to the Fig 10, the medians of the run-times increase linearly with the increase in the signal length showing the scalability of the approach. For the signal with 200 second length, the mean run-time for M-step (parameter estimation step) is 0.38 seconds with a standard deviation of 0.15 seconds.

Figure shows boxplots of the run-times of the proposed approach with different signal lengths. The black dots with blue circle in the middle of each boxplot denote median. The bottom and top of each blue box are the 25th and 75th percentiles of the sample, respectively. The red markers denote the outliers.

## Discussion

Inference of ANS activation from SC recordings is challenging given that the parameters of the underlying physiological system are unknown. The derived EM approach maximizes the complete data log-likelihood. The complete data log-likelihood has many degrees of freedom, i.e., the constraints on variables to be optimized are lower than the number of variables. In other words, there exist many solutions for the unknowns that can closely approximate the sampled signal. The use of a comprehensive state-space model and the elimination of cubic spline functions-based model reduces the number of unknown variables in optimization. For example, the number of cubic spline functions needed to model the slow varying component of 200 seconds is 39, as pointed out in our previous work [24]. On the other hand, the proposed comprehensive model requires only one parameter instead of multiple cubic spline function parameters to model the slow-varying component. Furthermore, we consider probabilistic sparsity priors motivated by physiology on ANS activation along with Gaussian priors on the physiological system parameters. Last but not least, we also enforce inequality and equality constraints on the state-space model parameters by trial and error. The constraints *τ*_{p} > 2*τ*_{r}, *τ*_{d} > 15*τ*_{p}, and *η* = 0.5 worked best for us for the dataset we have analyzed. [24]. [24].

Fig 2 shows that the estimations of the initial states as well as the states for about 20–30 seconds can be erroneous. After 20–30 seconds, the state estimate visually seems reasonable. This erroneous estimation occurs because the Kalman filter in the FIS needs a few samples to begin to follow the signal. Therefore, the estimations during the initial few samples can be erroneous. Due to this erroneous estimation of the initial state, the *R*^{2} estimate for male participant 12 became very low compared to other participants. One straightforward way to deal with this is to consider 20–30 seconds of measured signal padded in the beginning. After performing deconvolution in the padded signal, results corresponding to the initial 20–30 seconds can be removed.

For the comparative study with previous approaches, we assumed the timing of the auditory stimulation as the ground truth. It should be noted that the shape of the ROC curve is dictated by the three factors: 1) how many of the auditory stimuli are translated as SCRs by the neural pathway and corresponding physiology, 2) spontaneous SCRs, and 3) an algorithm’s ability to accurately model any SCRs along with the corresponding accurate estimation of ANS activations. If an auditory stimulation does not produce an SCR, all different algorithms will be penalized the same way in the ROC metric if that specific SCR is not detected (contributing as the false negative). Similarly, if there is a spontaneous SCR, all different algorithms will be penalized the same way in the ROC metric if detected (contributing as the false positive). As the first two cases are staying the same for all the algorithms, the relative change in the area in the AUC of the ROC curve will mean that this change is coming from the algorithm itself only. In this way we can benchmark our approach with previous algorithms. A better ROC will mean algorithms ability to reduce the false negatives and false positives. Fig 4A shows that our bayesianEDA has the best ROC curve than all the previous approaches, including our previously proposed spline-based approach [24]. Fig 4B shows that our bayesianEDA has the maximum AUC value of the corresponding ROC curves. The next best ones are our spline-based approach (AUC = 0.8003) and sparsEDA (AUC = 0.7783). The ROC curves and AUC values are generated based only on the classification ability between the event-related and non-event related SCRs among the ones that are only detected by each method. However, there is a possibility that an algorithm have over-sparsified the solution and missed many smaller but event-related SCRs. Therefore, we further calculate for how many of auditory stimulations no SCR was detected. Fig 4C shows that among all algorithms, our BayesianEDA approach has 24 undetected ANS activation, which is close to the correct number of undetected responses, which is 23. Detailed discussion is provided in S3 Appendix.

Readers should note that, unlike all the methods we considered for the comparison, PsPM [20, 45] was specifically developed to incorporate knowledge of external stimulation, and the dataset used comes from an experiment with defined stimulation. PsPM can utilize this defined stimulation information. All other approaches including ours perform “blind” deconvolution regardless of any external stimulation. This is more applicable in the envisioned application area, such as real-time deconvolution with wearables. It can also be thought of as a drawback when there is knowledge of stimulation, such as in most laboratory tasks. Therefore, here we used the spontaneous fluctuation (SF) suite for PsPM for our comparison, which also does not take the information of external stimulus as input. In the future, inspired by the PsPM framework, we plan to extend our proposed algorithm bayesianEDA to take the stimulus information as input in a probabilistic manner by changing the probability distribution of *u*(*t*) at the time when external stimulation information exists for a more contex-aware deconvolution.

The computational complexity of the deconvolution approach is as shown in [30]. Furthermore, our empirical investigation also shows that the run-time scales linearly with the number of samples, as shown in Fig 10. This shows the feasibility of implementing such approaches in low-power wearable medical devices for edge computation. This scalable implementation has been possible with the proposed comprehensive state-space model. The time complexity of the M-step of this approach is also of in terms of the number of samples. After E-step the calculation of the summations such as , etc. in Eq 17 has time complexity. Further optimization can be performed by obtaining the parameters of the physiological system for a smaller segment and performing the E-step for the longer segments. During a day of recording, parameters can be updated a few times by running the EM, and these parameters can be used to estimate the ANS activation using only E-step. A real-time implementation can be done with only running the Kalman filter in an iterative manner in the FIS after estimating the system parameters for a shorter segment. As Kalman filters are very cheap in terms of computation power, the proposed approach opens up the possibility of performing ANS activity inference on the edge device rather than running it in the cloud, facilitating low network traffic and user privacy.

In this study, we have proposed a novel physiological model inspired by the physiological understanding of sweat secretion that can better explain the variation in SC with fewer unknowns. Using our proposed model, we have developed a highly scalable deconvolution algorithm, which will enable efficient implementation in wearable devices. To achieve convergence, obtain a good fit of the model, and avoid overfitting, several parameters and constraint have been chosen on a trial-and-error basis because of the absence of in-depth physiological knowledge. There is room for improvement to come up with a more systematic way to address this limitation. Future studies can benefit from more motivation from physiology-motivated parameters and constraint selections.

ANS activities obtained from the single channel SC recording can be used to track the cognitive arousal state of an individual [2, 48, 49]. One of the future goals is to extend this approach for multi-channel SC recording and the nonlinearity of the model for a more robust inference in the presence of noise,leading to more reliable inference of individual arousal level similar to our previous study in [28]. For further accurate estimate of emotional arousal, we intend to utilize the inferred ANS activity from SC recordings with our approach and combine with other physiological signals similar to [50–56]. The proposed new model as well as the scalable ANS inference approach have enabled us to design a scalable control architecture to regulate the arousal level similar to the proposed framework in [57–60]. Finally, since some studies have reported inconsistencies in the *poral valve model* by Edlberg et al. [33] while investigating both SC and skin potential response [61], we plan to continue our investigation of the mechanism of sweat secretion to achieve improvements in the model and its understanding.

## Supporting information

### S1 Appendix. Expectation maximization.

The section provides a brief derivation of the Expectation Maximization.

https://doi.org/10.1371/journal.pcbi.1010275.s001

(PDF)

### S2 Appendix. Heuristic refinement of *u*.

The section provide a brief derivation of the heuristic refinement of ** u**.

https://doi.org/10.1371/journal.pcbi.1010275.s002

(PDF)

### S3 Appendix. Additional discussion.

The section provides a detailed discussion on performance comparison between different algorithms in terms of the number of undetected activations of ANS.

https://doi.org/10.1371/journal.pcbi.1010275.s003

(PDF)

### S1 Fig. Estimated decomposition of the experimental SC signals for female participant 1 to 6.

https://doi.org/10.1371/journal.pcbi.1010275.s004

(PDF)

### S2 Fig. Estimated decomposition of the experimental SC signals for female participant 7 to 13.

https://doi.org/10.1371/journal.pcbi.1010275.s005

(PDF)

### S3 Fig. Estimated decomposition of the experimental SC signals for male participant 1 to 6.

https://doi.org/10.1371/journal.pcbi.1010275.s006

(PDF)

### S4 Fig. Estimated decomposition of the experimental SC signals for male participant 7 to 13.

https://doi.org/10.1371/journal.pcbi.1010275.s007

(PDF)

### S5 Fig. Deconvolution results from the simulated SC signals with 25 dB SNR for female participant 1 to 6.

https://doi.org/10.1371/journal.pcbi.1010275.s008

(PDF)

### S6 Fig. Deconvolution results from the simulated SC signals with 25 dB SNR for female participant 7 to 13.

https://doi.org/10.1371/journal.pcbi.1010275.s009

(PDF)

### S7 Fig. Deconvolution results from the simulated SC signals with 25 dB SNR for male participant 1 to 6.

https://doi.org/10.1371/journal.pcbi.1010275.s010

(PDF)

### S8 Fig. Deconvolution results from the simulated SC signals with 25 dB SNR for male participant 7 to 13.

https://doi.org/10.1371/journal.pcbi.1010275.s011

(PDF)

### S9 Fig. Deconvolution results from the simulated SC signals with 35 dB SNR for female participant 1 to 6.

https://doi.org/10.1371/journal.pcbi.1010275.s012

(PDF)

### S10 Fig. Deconvolution results from the simulated SC signals with 35 dB SNR for female participant 7 to 13.

https://doi.org/10.1371/journal.pcbi.1010275.s013

(PDF)

### S11 Fig. Deconvolution results from the simulated SC signals with 35 dB SNR for male participant 1 to 6.

https://doi.org/10.1371/journal.pcbi.1010275.s014

(PDF)

### S12 Fig. Deconvolution results from the simulated SC signals with 35 dB SNR for male participant 7 to 13.

https://doi.org/10.1371/journal.pcbi.1010275.s015

(PDF)

### S13 Fig. Deconvolution results from the simulated SC signals with 25 dB SNR with pink noise for female participant 1 to 6.

https://doi.org/10.1371/journal.pcbi.1010275.s016

(PDF)

### S14 Fig. Deconvolution results from the simulated SC signals with 25 dB SNR with pink noise for female participant 7 to 13.

https://doi.org/10.1371/journal.pcbi.1010275.s017

(PDF)

### S15 Fig. Deconvolution results from the simulated SC signals with 25 dB SNR with pink noise for male participant 1 to 6.

https://doi.org/10.1371/journal.pcbi.1010275.s018

(PDF)

### S16 Fig. Deconvolution results from the simulated SC signals with 25 dB SNR with pink noise for male participant 7 to 13.

https://doi.org/10.1371/journal.pcbi.1010275.s019

(PDF)

## References

- 1.
Boucsein W. Electrodermal activity. Springer Science & Business Media; 2012.
- 2.
Wickramasuriya DS, Qi C, Faghih RT. A State-Space Approach for Detecting Stress from Electrodermal Activity. In: Annual International Conference of the IEEE Engineering in Medicine and Biology Society. IEEE Engineering in Medicine and Biology Society. Annual Conference. vol. 2018; 2018. p. 3562–3567.
- 3. Zheng YL, Ding XR, Poon CCY, Lo BPL, Zhang H, Zhou XL, et al. Unobtrusive sensing and wearable devices for health informatics. IEEE Transactions on Biomedical Engineering. 2014;61(5):1538–1554. pmid:24759283
- 4. Guo Y, Liu X, Peng S, Jiang X, Xu K, Chen C, et al. A Review of Wearable and Unobtrusive Sensing Technologies for Chronic Disease Management. Computers in Biology and Medicine. 2020; p. 104163. pmid:33348217
- 5. Johnson KT, Picard RW. Advancing Neuroscience through Wearable Devices. Neuron. 2020;108(1):8–12. pmid:33058768
- 6. Subramanian S, Barbieri R, Brown EN. Point process temporal structure characterizes electrodermal activity. Proceedings of the National Academy of Sciences. 2020;117(42):26422–26428. pmid:33008878
- 7. Walker ER, McGee RE, Druss BG. Mortality in mental disorders and global disease burden implications: a systematic review and meta-analysis. JAMA psychiatry. 2015;72(4):334–341. pmid:25671328
- 8. San Too L, Spittal MJ, Bugeja L, Reifels L, Butterworth P, Pirkis J. The association between mental disorders and suicide: A systematic review and meta-analysis of record linkage studies. Journal of affective disorders. 2019;.
- 9.
Murphy SL, Xu J, Kochanek KD, Arias E. Mortality in the united states, 2017. 2018;.
- 10. Shepard DS, Gurewich D, Lwin AK, Reed GA Jr, Silverman MM. Suicide and suicidal attempts in the United States: costs and policy implications. Suicide and Life-Threatening Behavior. 2016;46(3):352–362. pmid:26511788
- 11. Gross JJ, Jazaieri H. Emotion, emotion regulation, and psychopathology: An affective science perspective. Clinical Psychological Science. 2014;2(4):387–401.
- 12. Callaghan BC, Cheng HT, Stables CL, Smith AL, Feldman EL. Diabetic neuropathy: clinical manifestations and current treatments. The lancet NEUROLOGY. 2012;11(6):521–534. pmid:22608666
- 13. Freedman BI, Bowden DW, Smith SC, Xu J, Divers J. Relationships between electrochemical skin conductance and kidney disease in type 2 diabetes. Journal of Diabetes and its Complications. 2014;28(1):56–60. pmid:24140119
- 14. Freedman BI, Smith SC, Bagwell BM, Xu J, Bowden DW, Divers J. Electrochemical skin conductance in diabetic kidney disease. American journal of nephrology. 2015;41(6):438–447. pmid:26228248
- 15. He T, Wang C, Zuo A, Liu P, Zhao R, Li W, et al. Electrochemical skin conductance may be used to screen for diabetic cardiac autonomic neuropathy in a Chinese population with diabetes. Journal of diabetes research. 2017;2017.
- 16. Gerrett N, Griggs K, Redortier B, Voelcker T, Kondo N, Havenith G. Sweat from gland to skin surface: production, transport, and skin absorption. Journal of Applied Physiology. 2018;125(2):459–469. pmid:29745799
- 17. Lim CL, Rennie C, Barry RJ, Bahramali H, Lazzaro I, Manor B, et al. Decomposing skin conductance into tonic and phasic components. International Journal of Psychophysiology. 1997;25(2):97–109. pmid:9101335
- 18. Alexander DM, Trengove C, Johnston P, Cooper T, August J, Gordon E. Separating individual skin conductance responses in a short interstimulus-interval paradigm. Journal of neuroscience methods. 2005;146(1):116–123. pmid:15935228
- 19. Benedek M, Kaernbach C. A continuous measure of phasic electrodermal activity. Journal of neuroscience methods. 2010;190(1):80–91. pmid:20451556
- 20. Bach DR, Daunizeau J, Friston KJ, Dolan RJ. Dynamic causal modelling of anticipatory skin conductance responses. Biological psychology. 2010;85(1):163–170. pmid:20599582
- 21. Greco A, Valenza G, Lanata A, Scilingo EP, Citi L. cvxEDA: A convex optimization approach to electrodermal activity processing. IEEE Transactions on Biomedical Engineering. 2016;63(4):797–804. pmid:26336110
- 22.
Faghih RT, Stokes PA, Marin MF, Zsido RG, Zorowitz S, Rosenbaum BL, et al. Characterization of fear conditioning and fear extinction by analysis of electrodermal activity. In: Engineering in Medicine and Biology Society (EMBC), 2015 37th Annual International Conference of the IEEE. IEEE; 2015. p. 7814–7818.
- 23.
Amin MR, Faghih RT. Sparse Deconvolution of Electrodermal Activity via Continuous-Time System Identification. IEEE Transactions on Biomedical Engineering. 2019;.
- 24.
Amin MR, Faghih RT. Identification of Sympathetic Nervous System Activation from Skin Conductance: A Sparse Decomposition Approach with Physiological Priors. IEEE Transactions on Biomedical Engineering. 2020;.
- 25. Bach DR, Flandin G, Friston KJ, Dolan RJ. Time-series analysis for rapid event-related skin conductance responses. Journal of neuroscience methods. 2009;184(2):224–234. pmid:19686778
- 26. Benedek M, Kaernbach C. Decomposition of skin conductance data by means of nonnegative deconvolution. Psychophysiology. 2010;47(4):647–658. pmid:20230512
- 27.
Amin MR, Faghih RT. Inferring autonomic nervous system stimulation from hand and foot skin conductance measurements. In: 2018 52nd Asilomar Conference on Signals, Systems, and Computers. IEEE; 2018. p. 655–660.
- 28. Amin MR, Faghih RT. Robust Inference of Autonomic Nervous System Activation Using Skin Conductance Measurements: A Multi-Channel Sparse System Identification Approach. IEEE Access. 2019;7:173419–173437.
- 29.
Amin MR, Faghih RT. Tonic and Phasic Decomposition of Skin Conductance Data: A Generalized-Cross-Validation-Based Block Coordinate Descent Approach. In: 2019 41st Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC). IEEE; 2019. p. 745–749.
- 30. Kazemipour A, Liu J, Solarana K, Nagode DA, Kanold PO, Wu M, et al. Fast and stable signal deconvolution via compressible state-space models. IEEE Transactions on Biomedical Engineering. 2017;65(1):74–86. pmid:28422648
- 31.
Bach DR, Flandin G, Friston KJ, Dolan RJ. PsPM-SCRV10: Skin conductance responses to loud sounds, simultanously recorded from palm, fingers and foot; 2017. Available from: https://doi.org/10.5281/zenodo.291465.
- 32. Bach DR, Flandin G, Friston KJ, Dolan RJ. Modelling event-related skin conductance responses. International Journal of Psychophysiology. 2010;75(3):349–356. pmid:20093150
- 33.
Edelberg R. Electrodermal mechanisms: A critique of the two-effector hypothesis and a proposed replacement. In: Progress in electrodermal research. Springer; 1993. p. 7–29.
- 34. Hernando-Gallego F, Luengo D, Artés-Rodríguez A. Feature Extraction of Galvanic Skin Responses by Non-Negative Sparse Deconvolution. IEEE Journal of Biomedical and Health Informatics. 2017;. pmid:29990244
- 35. Jain S, Oswal U, Xu KS, Eriksson B, Haupt J. A compressed sensing based decomposition of electrodermal activity signals. IEEE Transactions on Biomedical Engineering. 2017;64(9):2142–2151. pmid:27893381
- 36. Chaspari T, Tsiartas A, Stein LI, Cermak SA, Narayanan SS. Sparse representation of electrodermal activity with knowledge-driven dictionaries. IEEE Transactions on Biomedical Engineering. 2014;62(3):960–971. pmid:25494494
- 37. Wickramasuriya DS, Amin M, Faghih RT, et al. Skin conductance as a viable alternative for closing the deep brain stimulation loop in neuropsychiatric disorders. Frontiers in neuroscience. 2019; p. 780. pmid:31447627
- 38. Bach DR, Friston KJ, Dolan RJ. An improved algorithm for model-based analysis of evoked skin conductance responses. Biological psychology. 2013;94(3):490–497. pmid:24063955
- 39. Ghasemi Z, Lee JC, Kim CS, Cheng HM, Sung SH, Chen CH, et al. Estimation of cardiovascular risk predictors from non-invasively measured diametric pulse volume waveforms via multiple measurement information fusion. Scientific reports. 2018;8(1):1–11. pmid:29992978
- 40.
Murray JF. Visual recognition, inference and coding using learned sparse overcomplete representations. University of California, San Diego; 2005.
- 41. Zdunek R, Cichocki A. Improved M-FOCUSS algorithm with overlapping blocks for locally smooth sparse signals. IEEE Transactions on Signal Processing. 2008;56(10):4752–4761.
- 42. Pietrock C, Ebrahimi C, Katthagen TM, Koch SP, Heinz A, Rothkirch M, et al. Pupil dilation as an implicit measure of appetitive Pavlovian learning. Psychophysiology. 2019;56(12):e13463. pmid:31424104
- 43.
Macmillan NA, Creelman CD. Detection theory: A user’s guide. Psychology press; 2004.
- 44. Moskowitz CS, Pepe MS. Quantifying and comparing the predictive accuracy of continuous prognostic factors for binary outcomes. Biostatistics. 2004;5(1):113–127. pmid:14744831
- 45. Bach DR, Staib M. A matching pursuit algorithm for inferring tonic sympathetic arousal from spontaneous skin conductance fluctuations. Psychophysiology. 2015;52(8):1106–1112. pmid:25930177
- 46. Faghih RT, Dahleh MA, Adler GK, Klerman EB, Brown EN. Deconvolution of serum cortisol levels by using compressed sensing. PLoS ONE. 2014;9(1):e85204. pmid:24489656
- 47. Faghih RT, Dahleh MA, Adler GK, Klerman EB, Brown EN. Quantifying pituitary-adrenal dynamics and deconvolution of concurrent cortisol and adrenocorticotropic hormone data by compressed sensing. IEEE Transactions on Biomedical Engineering. 2015;62(10):2379–2388. pmid:25935025
- 48.
Wickramasuriya DS, Faghih RT. A Bayesian Filtering Approach for Tracking Arousal from Binary and Continuous Skin Conductance Features. IEEE Transactions on Biomedical Engineering. 2019;.
- 49.
Wickramasuriya DS, Faghih RT. A Marked Point Process Filtering Approach for Tracking Sympathetic Arousal from Skin Conductance. IEEE Access. 2020;.
- 50.
Wickramasuriya DS, Faghih RT. A novel filter for tracking real-world cognitive stress using multi-timescale point process observations. In: Engineering in Medicine and Biology Society (EMBC), 2019 41st Annual International Conference of the IEEE. IEEE; 2019.
- 51.
Wickramasuriya DS, Faghih RT. A cortisol-based energy decoder for investigation of fatigue in hypercortisolism. In: Engineering in Medicine and Biology Society (EMBC), 2019 41st Annual International Conference of the IEEE. IEEE; 2019.
- 52.
Wickramasuriya DS, Faghih RT. Online and offline anger detection via electromyography analysis. In: 2017 IEEE Healthcare Innovations and Point of Care Technologies (HI-POCT). IEEE; 2017.
- 53.
Wickramasuriya DS, Faghih RT. A mixed-filter algorithm for arousal tracking from galvanic skin response and heart rate measurements. In: IEEE-EMBS Iternational Conference on Biomedical and Health Informatics; 2019.
- 54.
Parshi S, Amin MR, Azgomi HF, Faghih RT. Mental Workload Classification via Hierarchical Latent Dictionary Learning: A Functional Near Infrared Spectroscopy Study. In: IEEE-EMBS Iternational Conference on Biomedical and Health Informatics; 2019.
- 55.
Ahmadi MB, Craik A, Azgomi HF, Francis JT, Contreras-Vidal JL, Faghih RT. Real-time seizure state tracking using two channels: A mixed-filter approach. In: 2019 53rd Asilomar Conference on Signals, Systems, and Computers. IEEE; 2019.
- 56.
Ravindran AS, Nakagome S, Wickramasuriya DS, Contreras-Vidal JL, Faghih RT. Emotion recognition by point process characterization of heartbeat dynamics. In: 2019 IEEE Healthcare Innovations and Point of Care Technologies (HI-POCT). IEEE; 2019.
- 57.
Azgomi HF, Wickramasuriya DS, Faghih RT. State-space modeling and fuzzy feedback control of cognitive stress. In: 2019 41st Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC). IEEE; 2019. p. 6327–6330.
- 58.
Azgomi HF, Faghih RT. A wearable brain machine interface architecture for regulation of energy in hypercortisolism. In: 2019 53rd Asilomar Conference on Signals, Systems, and Computers. IEEE; 2019. p. 254–258.
- 59. Faghih RT, Dahleh MA, Brown EN. An optimization formulation for characterization of pulsatile cortisol secretion. Frontiers in neuroscience. 2015;9:228. pmid:26321898
- 60.
Seet M, Amin MR, Abbasi NI, Hamano J, Bezerianos A, Faghih RT, et al. Olfactory-induced Positive Affect and Autonomous Response as a Function of Hedonic and Intensity Attributes of Fragrances. In: Engineering in Medicine and Biology Society (EMBC), 2020 42nd Annual International Conference of the IEEE. IEEE; 2020. p. 7814–7818.
- 61. Tronstad C, Kalvøy H, Grimnes S,Martinsen ØG. Waveform difference between skin conductance and skin potential responses in relation to electrical and evaporative properties of skin. Psychophysiology. 2013;50(11):1070–1078. pmid:23889171