{'fraction_non_alphanumeric': 0.027866948978894884, 'fraction_numerical': 0.008298613482685608, 'mean_word_length': 4.823985680190931, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Decision SincNet: Neurocognitive models of decision making that predict cognitive processes from neural signals

Human decision making behavior is observed with choice-response time data during psychological experiments. Drift-diffusion models of this data consist of a Wiener first-passage time (WFPT) distribution and are described by cognitive parameters: drift rate, boundary separation, and starting point. These estimated parameters are of interest to neuroscientists as they can be mapped to features of cognitive processes of decision making (such as speed, caution, and bias) and related to brain activity. The observed patterns of RT also reflect the variability of cognitive processes from trial to trial mediated by neural dynamics. We adapted a SincNet-based shallow neural network architecture to fit the Drift-Diffusion model using EEG signals on every experimental trial. The model consists of a SincNet layer, a depthwise spatial convolution layer, and two separate FC layers that predict drift rate and boundary for each trial in-parallel. The SincNet layer parametrized the kernels in order to directly learn the low and high cutoff frequencies of bandpass filters that are applied to the EEG data to predict drift and boundary parameters. During training, model parameters were updated by minimizing the negative log likelihood function of WFPT distribution given trial RT. We developed separate decision SincNet models for each participant performing a two-alternative forced-choice task. Our results showed that single-trial estimates of drift and boundary performed better at predicting RTs than the median estimates in both training and test data sets, suggesting that our model can successfully use EEG features to estimate meaningful single-trial Diffusion model parameters. Furthermore, the shallow SincNet architecture identified time windows of information processing related to evidence accumulation and caution and the EEG frequency bands that reflect these processes within each participant.


I. INTRODUCTION
Perceptual decision making is a crucial part of cognition. Humans must rapidly translate sensory information into behavioral responses in order to achieve their goals, e.g., stop at a red traffic light. In the field of mathematical psychology and computational neuroscience, much effort has been dedicated to develop computational models that describe the mechanism of perceptual decision-making. The Drift-Diffusion Model (DDM) is the most widely used model [1] to explain choice and response time data in perceptual decision making tasks, by assuming that decisions are made through sequential sampling and integration of sensory information [2]. Fig. 1 depicts the Drift-Diffusion Model (DDM), where the x-axis is the time from viewing of a stimulus. After some processing time for neural encoding of the sensory stimulus, a Decision Variable (DV) begins a random walk process from starting point z between two decision boundaries, which represent the two choice options. The DV is updated by gradually accumulating samples drawn from noisy sensory evidence in favor of one of the two outcomes, until it reaches either the upper or the lower bound. Subsequently, the motor system then executes a response after the DV reaches one of two boundaries.
The average increase of change in a unit interval during evidence accumulation is parameterized as the drift rate δ, and the instantaneous variance in the rate of change is parameterized as diffusion coefficient ς. This variance simply scales the model and is fixed to 1. Boundary separation α describes the distance between two choices. The parameter β encodes the starting position of evidence accumulation, which reflects the bias towards one of the two choices. When β is 0.5, the starting position is in the middle between two boundaries and thus the start of evidence accumulation is unbiased between the two choices. Visual encoding time before evidence accumulation and motor execution after evidence accumulation could be expressed as τ e and τ m [3] respectively, but only the sum of both processes, non-decision time τ , can be observed with behavior alone. The model is also referred to as Wiener For a given trial, after visual encoding time (τe), a DV begins evidence accumulation process and will hit either the upper of the lower bound. Mean rate of evidence accumulation of is indicated by the vector in black. Blue curve indicates the probability density function (pdf) of RTs when Choice 1 is correctly executed, and red curve indicates the pdf of RTs when Choice 2 is correctly. An error is made when the DV drifts to the wrong bound due to noise. Dotted curve indicates the pdf of RTs for incorrect trials. The axis above shows the EEG data for each trial after using SVD to maximize N200 signals, which can be used to track onset of evidence accumulation.
Diffusion Model, because an unbiased, continuous evidence accumulation can be expressed as follow [4]: X t denotes the diffusion state, dX t denotes the change in X over a small time interval dt, and W t is the Wiener Process.
Evidence accumulated continuously will result in the distribution of boundary cross times, described as the Wiener firstpassage time (WFPT) distribution: T ∼ W iener(α, β, τ, δ). One of the most critical aspects of the DDM is that different parameters can empirically represent underlying cognitive components of the decision making process. During decision making experiments, separate manipulation of processing speed, caution, bias, and motor execution could be reflected in changes in the corresponding parameters δ, α, β, and τ [5]. Thus, there has been considerable interest in linking the DDM parameters to brain activity, and more recently, interest in developing neurocognitive models that incorporate brain activity directly into the diffusion model framework to obtain novel insights into decision making, in particular, to the variability in decision making across observations.

II. RELEVANT WORK
Simulation studies with the DDM have demonstrated the importance of trial-to-trial variability in drift rate, starting point, and boundary to empirically model two-choice response time data [6]. Allowing drift rate and starting point to vary from trial to trial can uniquely capture properties of response time distribution for correct and incorrect choices. Variability in caution reflect adjustments in speed-accuracy trade-off.
Although variability in cognitive processes in decision is well-known, choice-response time does not provide enough data to estimate model parameters at a trial level. Often models with model-intrinsic trial-to-trial variability, such as assuming a normal distribution for trial-to-trial drift rates are fit to data. Fitting these models provide estimates of summary parameters across trials (e.g. mean and standard deviation of the drift rates across trials). One method to estimate DDMs while allowing intrinsic trial-to-trial variability of parameters is to use Bayesian Hierarchical Diffusion Models [7]. The Bayesian modeling approach is used to compute posterior distribution of model parameters, and employs Monte Carlo Markov Chain (MCMC) algorithm to generate samples from the posterior distribution until they converge.
Accumulation-to-bound patterns have also been found in different areas of the brain [8,9]. There has been a growing interest to incorporate neural data along with behavioral data to build neurocognitive models of decision making [2,3,10,11]. Previous work has shown that incorporating single-trial EEG measures of attention into the HDDM yields better outof-sample predictions on accuracy and reaction time distributions relative to using behavioral data alone [2]. Model parameters (δ, τ , ς) on each trial were assumed to be a linear combination of single-trial EEG. The EEG measures were derived using known stimulus-locked EEG signals, i.e., event-related potentials (ERPs) estimated by averaging the trials. More specifically, to augment the signal-to-noise (SNR) ratio of single-trial EEG, singular value decomposition (SVD) was used to find channel weights that maximally explain the variance of specific evoked potentials (N200, P200). These weights were applied to single-trial EEG to obtain latency and amplitude measures of the N200/P200 per trial as regressors onto HDDM parameters. This successful line of work has suggested that trial-level neural dynamics account for some of the trial-to-trial variability in the HDDM model parameters. However, while using MCMC alone can robustly estimate posterior distributions from which the trial parameters are drawn, it does not have the resolution to directly link triallevel neural representation to trial-level parameters estimated. Moreover, this approach was limited to using trial averaged ERP signals to provide a template of hypothetical signals linked to DDM parameters.
The current research aims to use a neural network to estimate drift rate δ and boundary α parameters of the DDM on single trials directly from the raw EEG data. Machine learning approaches such as filter bank common spatial patterns (FBCSP) have been widely used to extract EEG features [12], but it has the disadvantage of requiring artificially-selected frequency bands. Convolutional Neural Networks (CNNs) have shown promising results on decoding brain activities [13,14] using raw EEG data, but filters and feature maps obtained can be hard to interpret. SincNet is a recently proposed deep learning neural network used to process raw time series data such as speech and EEG data [15]. The key feature of SincNet is that each kernel from the first layer of CNN is parameterized as a sinc function and acts as a band-pass filter that could be applied to the time series. Two cut-off frequencies are the only trainable parameters needed. Therefore, SincNet is advantageous because fewer parameters are needed and the filter parameters are themselves optimized by the training data. The model structure has successfully been used on different EEG decoding tasks since its inception [16,17].
We developed a Decision SincNet model that can learn the windows of time and frequency bands in the EEG that are useful to predict trial level DDM parameters. This Decision SincNet model is scientifically significant for the following reasons.
1) By using the WFPT likelihood as a loss function, we can use gradient descent to learn an end-to-end model to fit two DDM parameters (drift rate and boundary) from raw EEG data, and apply it to predict cognitive parameters in new unseen brain data. 2) By using neural network models, we can get trial-level predictions of parameters 3) By applying interpretation techniques to the SincNet layer and depthwise layer, we can automatically learn relevant neural dynamics (e.g., time windows and frequency bands) that are critical to modeling the evidence accumulation process.

A. Behavioral and EEG dataset
We used behavioral and EEG data collected while participants performed a two-alternative forced-choice task where they discriminated whether a Gabor patch presented with added dynamic noise is higher or lower spatial frequency. Task difficulty was manipulated by the difference in spatial frequency (perceptual evidence) between the two choices in order to manipulate the evidence available to make the discrimination. Participants performed the task in blocks of trials at 3 levels of difficulty (spatial frequency difference). Each subject performed 360 trials, while 128 channels of EEG and behavioral data were recorded. Independent Component Analysis (ICA) based artifact rejection method was used on EEG data to remove eyeblinks, electrical noise, and muscle artifact. EEG data were bandpass filtered to 1 to 50 Hz, and then downsampled from 1000 Hz to 500 Hz prior to data analysis.

B. Wiener first-passage time model of response time
For each trial, the likelihood of Wiener First-Passage Time (WFPT) was calculated with RT (t) by using a small-time approximation where m is the number of expansion terms required for approximation of the likelihood function. We fix m to be 10, as it is sufficient for the approximation for modeling data where t < 2 [18]. β is set to be 0.5, so that the starting point is always unbiased at z = βα. τ is non-decision time, which is set to be 0.93·RT min for each subject, approximating Bayesian MCMC modeling results [3].
Given a dataset D := {(x 1 , y 1 ) , . . . , (x N , y N )} consisting of N trials x n ∈ R C×D , i.e., EEG signals of C channels by N time samples, and corresponding observed response times t n ∈ R, n = 1, . . . , N . The likelihood factorizes according to where we defined X := {x 1 , . . . , x N } and T := {t 1 , . . . , t N } as the sets of inputs and corresponding targets, respectively. Both the drift rate δ and the boundary α are the functions of x parameterized by the a deep neural network θ.
To find the optimal parameters θ of the non-linear regression problem, we minimize the negative log-likelihood whereᾱ is the average boundary within a training batch, in order to avoid overfitting of the boundary parameter. Since the gain of varying the boundary parameter outweighs the gain of varying the drift parameter given the nature of the WFPT likelihood function, we use this method to update trial-level boundary while considering the fit within a batch.

C. Decision SincNet Model
The Decision SincNet model is built to use trial-level EEG data to simultaneously predict drift rate and boundary separation in an individual participant. The model architecture is similar to Sinc-ShallowNet [15] and consists of four blocks, as shown in Table 1 and visualized in Fig. 2. The model applies band-pass filters and spatial filters on the EEG data, pools the filtered data, and finally predicts the two parameters of the diffusion model inparallel. There are 7556 trainable parameters in total. All the methods mentioned below may be reproduced by using the code on Github (https://github.com/jennyqsun/EEG-Decision-SincNet). The Deep Learning Models were developed in PyTorch [19], and trained from scratch using a workstation equipped with NVIDIA GeForce RTX 2080 Ti and 64 GB of RAM. On average, a model per subject takes five minutes to train. The first block is a Sinc-convolutional layer [16]. Thirtytwo kernels are parameterized by two cutoff frequencies of a Sinc Function. The low and high frequencies (f 1 and f 2 ) are trainable parameters of the model during learning, so the kernel can be expressed in the time domain as: To avoid ripples in the signal, a Hamming window is applied to the bandpass filters [15]. Thus, the output from the SincNet layer is from a 2D Convolution between i th trial EEG data and the j th kernel k j . Since the kernel size has only one dimension, it is equivalent to 1D Convolution between signals from each channel x c and k j : where c ∈ [0, C − 1], j ∈ [0, K − 1] with K representing the total number of kernels, y c,j [n] is the filtered signals as the output from the Sinc layer, and L is the length of the kernel. We set L = 131 such that lowest central frequency possible is around 4 Hz when sampling rate is 500 Hz [16]. The second block is a depthwise convolution layer where spatial kernels are applied to time series data with a depth of 2. Each temporally-filtered version of the input convolves with two spatial filters followed by the ReLU activation function.
The third block consists of pooling operation. The window size and stride size are always set in a way such that they are equivalent to 250ms and 100ms, respectively, when scaling back to the original input.
Following the Multi-task learning (MTL) paradigm [20], the last block has two "task-specific" layers that share all the previous hidden layers. MTL improves model performance by acting as a form of regularization, causing the model to prefer hypotheses that explain more than one task. The shared temporal-and spatial-filtered features are flattened and fed to two separate fully-connected (FC) layers to simultaneously produce two outputs, trial drift rate (δ) and trial boundary (α). The two parameters are fit using the same loss function during training. Predicted drift rates are clamped such that δ ∈ [−6, 6], in order to avoid extreme values of the negative log likelihood. A modified Sigmoid activation function, constrains the predicted alpha to a realistic range,α ∈ (1, 2.72).
To constrain the predicted value of boundary, output from its corresponding FC layer is followed by a modified Sigmoid activation, as shown in Fig. 3: The derivative of the modified Sigmoid is:

D. Modeling the Diffusion Process
Given a drift rate δ, the DV could hit either of the boundaries due to noise. Variability across time in the diffusion process can drive the process to terminate at the wrong boundary by mistake. A diffusion model that views correct and incorrect choices as the two boundaries will produce two different shapes of probability distributions. Decision SincNet is designed to make a point estimate of diffusion model parameters using one EEG trial. We modeled the two boundaries as the two choices, where drifting to the upper bound represents one choice, and drifting to the lower bound represents the process towards the other choice, and assumed there was no starting bias between the choices, which is a reasonable assumption for the data sets tested here. The response times for two choices are assumed to have identical probability density function and could be estimated using the same likelihood function. The main purpose of our approach is to directly predict model parameters from the EEG data on each trial.

E. Training
Before training, each subject's data were split into 80% for training and validation, and the other 20% for testing. For each subject, 1 second of EEG trials after stimulus onset were used as inputs, and the corresponding RTs were used as training labels. Separate models are trained for each subject. Initial bandpass filters were randomly selected from a uniform distribution, U ∼ (1, 32). Weights are updated by the gradient descent as η is the learning rate and it was set to be 10 −3 . The model was trained using batch size of 64, and Adaptive moment estimation (Adam) optimizer was used. To avoid overfitting, early stopping technique was applied with a patience score of 20.
F. Model Evaluation 1) Trial-to-trial Variability of the Estimates: Spearman's Rank-Order Correlation was used to examine the direction and strength between estimated parameters and observed RTs. Strong correlations would suggest that the model captures trial-by-trial neural variability that are reflected in RTs and can be mapped onto drift rates and boundaries.
2) Comparison Between Decision SincNet and Bayesian MCMC Models: The distribution of trial estimates for a subject obtained from Decision SincNet should fall within reasonable ranges. We compared our results to Bayesian MCMC model fits using JAGS sampler to estimate posterior distributions of the model parameters using only behavioral data. The fit of a basic model use the following prior structure [2]: After obtaining the posterior distributions of the parameters, we compare the distribution of the trial estimates and check if they were within sensible ranges.

3) Model Comparison by Log Likelihood of WFPT:
To check whether EEG data have the resolution to give rise to meaningful trial-level estimates, we can compare the sum of negative log-likelihood − log Wiener (t i | δ, α, β, τ ) (δ, α | t) of the training RT between trial level estimates of parameters and median estimates of parameters. We compare the possible combinations of likelihood of single trial estimates with median estimates, namely, . If the sum of the negative likelihood of either trial drift and trial alpha is smaller than that of median drift and alpha, we can conclude that the brain data is meaningfully linked to the trial to trial variability in behavior.

G. Generalization of the model
To check whether the trained model could be generalized to unseen data, we compared sum of negative log-likelihood of test RT data using the median parameter estimates obtained from training data δ train , α train | t test i with all combinations of trial parameter estimates from trial EEG data ) . Higher likelihood indicates that single trial EEG produced meaningful trial level predictions of DDM parameters.
1) Predictive Uncertainty: Monte Carlo dropout [21] is applied to estimate the uncertainty of predictive drift rates and boundaries. Mathematically, the use of dropout in a neural network can be viewed as Bayesian approximation of a Gaussian process [22]. Dropout is enabled during predictions in which different neurons are randomly deactivated with a constant dropout rate. After the repeated random sampling process, we can approximate the following predictive distribution [b] 2) Interpretability of Decision SincNet: After training, we inspected the frequency bands that were learned. An example of interpretable bandpass filters from one subject is demonstrated in Fig. 4. Each filter is represented by the cutoff frequencies f 1,j and f 2,j . Filters learn to move from their initial random frequency bands and change the cutoff frequencies. We use gradient-based technique to interpret the learned bandpass filters and spatial filters for each subject following [16]. We extend the method to further interpret pooled time windows. Critical temporal filters and time periods are evaluated based on the idea of saliency maps [23]. A forward pass is performed on an input i of interest followed by the calculation of the gradient of an output Y with respect to a feature of interest F as w = δY δF Fi . Important features are identified as the ones with the largest normalized gradient. The use of the gradient relies on the approximation of the output by applying a first-order Taylor expansion Y (F ) ≈ w T F + b. Fig. 5 shows an example from the same subject using the method. Three different color demonstrates three different frequency bands that are most critical to the prediction based on their normalized gradient. Absolute values of the spatial filters associated with a specific band-pass filter are then analyzed for the significance of each electrode. Panel A demonstrates the important weights identified. Each subplot shows two sets of important weights for a specific frequency band. This is because two separate spatial filters are applied to each filtered output from SincNet layer. Panel B demonstrates the important time windows obtained from the saliency map of the pooling layer, labeled by the center frequency of the corresponding critical frequency bands. In the example subject shown here, gamma band (31 Hz, 41 Hz) throughout the decision interval, and beta band (24 Hz) activity around the response were the most important bands.

IV. RESULTS
Because Decision SincNet predicts two parameters that can not be observed directly, model performance was evaluated by focusing on the following issues: model comparison, trialto-trial variability of the parameters within each subjects, model generalization to unseen data, and uncertainty of model prediction. Fig. 6 presents the comparison of model performance of one subject using the trained Decision SincNet model. Fig. 6A and Fig. 6B show the trial-by-trial correlations between estimated parameters and observed RTs from the training data. The Spearman correlation between fitted drift rates (δ) and 1/RT are strong (ρ = 0.937, p < 0.001). 1/RT is used as a proxy of speed of information processing. Spearman Correlation between fitted alpha and RT are moderately strong (ρ = 0.401, p < 0.001). Logarithm of RT and boundary is used to uncluster the data for visualization. Fig. 6C and Fig. 6D compare the distributions based on parameters estimated by different models from the training EEG data. Random samples from the posterior distributions based on Bayesian MCMC model are drawn to match to the samples size of Decision SincNet during training, and Kullback-Leibler (KL) Divergence was calculated for each of the parameters. Divergence of distribution of trial drift rates based on Decision SincNet from the posterior distribution of drift based on Bayesian MCMC is 77.714. Divergence of distribution of trial boundary based on Decision SincNet from the posterior distribution of alpha based on Bayesian MCMC is 0.347. These results suggest that single trial drift rates estimated from Decision SincNet contains more trial specific information, as it is more distinct from the posterior distribution of drift from the Bayesian MCMC. Fig. 6E and Fig. 6F show the trial-by-trial correlations between estimated parameters and observed RTs from test data, which the model has never been seen. The correlation between fitted drift rates and 1/RT are moderately strong (ρ = 0.517, p < 0.001), and the correlation between fitted alpha and RT are moderately strong (ρ = 0.468, p < 0.001). More examples examples are shown here in the Fig. 7. Each column represents the performance of a subject, and each row represents the relationship between response times (x-axis) and parameters estimated from the model (y-axis). Spearman correlations are also reported in caption.
We also compared the sum of negative likelihood as described above in Method Section (E.3). Our results indicate that using single trial estimates of both drift and boundary performs the best, as δ, α | t train i has the lowest value. This suggests that the model was trained to extract sufficient brain data to distinguish RT variability on each trial by mapping brain signals to model parameters. When we performed out-ofsample prediction by using the trained model to predict unseen EEG data, all the likelihoods of the single trial estimates , outperform the likelihood of the median estimates obtained from training data, δ train , α train | t test i , implying a successful predictive model with ability to generalize to unseen data. The model was able to fit and predict drift and boundary for all subjects (n=45) within reasonable ranges. During training, 41 out of 45 subjects showed the likelihood test of the single trial estimates of both parameters outperform the likelihood test of the median estimates, suggesting the benefit of single trial estimates for model fitting. When we test the trained model on unseen data, 14 out of 45 subjects have demonstrated that the likelihood of having either or both single trial estimates outperforms the likelihood of the median estimates, indicating that meaningful single-trial parameter estimates could be generalized to out-of-sample brain data for a subset of the subjects. We believe the performance in out-ofsample prediction would be improved with more data in each participant.

V. CONCLUSION
We proposed and validated the Decision SincNet, a neurocognitive model of decision making that integrates EEG data and the drift diffusion model estimated by a neural network. The end-to-end model uses the likelihood function of Wiener first-passage time to train the model on one second of EEG data given the RT. We have shown that the model can simultaneously predict two cognitive parameters of Drift-Diffusion model that reflect speed and caution during decision making. The model uses interpretable convolutional layers, that automatically learned bandpass filters, channel weights, and critical time windows which can be inspected to understand EEG relationships to human cognition. Various methods of model evaluation and post-doc analysis of the model have also been discussed. Examples of the model results are reported.
Future work should aim to tackle some of the current challenges of this new approach. Even though single trial drift and boundary are often the best model during training, the average of fitted parameters sometimes remained the most useful estimates when testing the model on unseen data, suggesting low signal-to-noise ratio in single-trial EEG data in some participants. There are also cases where the model learns to map the trial-to-trial variability of only one of the parameters, but not both. To test whether this is a genuine observation, we need experimental data where each parameter is experimentally manipulated [5] with simultaneous EEG recordings. Although taking the average of boundary during optimization showed results that are more consistently with the results from Bayesian MCMC model, better optimization tech- niques should be developed to bypass the issue of overfitting boundary parameter. We have recently developed a follow-up approach to address this issue by additionally forcing the drift parameter to find solutions that correlate with the RT during optimization. We also believe the model performance could be improved by manipulating the Decision SincNet architecture, in order to fit the entire set of DDM parameters, including bias and non-decision time. Future work should also extend the model to incorporate likelihood functions for incorrect trials with a joint behavioral and EEG dataset that has lower accuracy. Finally, other explainable deep learning techniques for EEG signals such as occlusion sensitivity analysis for estimating source signals [24] should be explored.