Emotional Analysis Prediction Using Qualita-Tively Representations of Multiple Psycho-Phys - Iological Time-Series Signals
Emotional Analysis Prediction Using Qualita-Tively Representations of Multiple Psycho-Phys - Iological Time-Series Signals
Emotional Analysis Prediction Using Qualita-Tively Representations of Multiple Psycho-Phys - Iological Time-Series Signals
1G. Hernandez, BDBI ESCI-UPF, Barcelona, Spain, on an internship at the University of Girona, Spain
([email protected]); 2B. Lopez, PhD, eXit research group, University of Girona, Spain.
([email protected]).
Abstract
Motivation: This report provides techniques to deal with time-series emotional data. Transforming time-series
data into qualitatively representations enables to reduce the complexity to mine the data while not altering the
dimensionality by having a vocabulary. The method uses several individuals with an audiovisual stimulus and
records multiple psychophysiological signals. Signals can be retrieved with a simple wristband, providing in time
data and auto supervised, the best possible scenario for supervised and deep learning to take part.
Results: Multiple classifications and regression techniques are used to predict different emotions and accomplish
a proper classification, reducing the error of prediction progressively. The methods are based on the mining of
sequence information from the representations, giving insight into pattern recognition and sequence alignment to
take knowledge from the data.
Supplementary information: Supplementary data are available at GitLab link, https://gitlab.com/ghg98/tfg-
exit-emotional_prediction.git
A time series C of length n can be represented in a w Fig. 2. Steps performed by SAX algorithm. (a) Raw time-series. (b)
PAA formation and normalisation. (c) Gaussian distribution of space.
dimensional space by a vector 𝐶̅ = 𝑐̅1 ,… , 𝑐̅𝑤 . The ele-
(d) qualitatively discretisation.
ment 𝑖 𝑡ℎ 𝑜𝑓 𝐶̅ is calculated by the following equation
G. Hernández et al.
Although the SAX representations are widely used, they matrix, from where one-neighbour classifier and svm
show a particular drawback. Parameters must be set performs the classification.
manually to minimise the error (see Figure 3). Alphabet
length, PAA segments length, slopes (prominence of the The method uses two distance measurements:
slopes in the result) and stiffness (percentage of the length
“n” of the time series to discretise) are parameters that (1) EpDtw:
must be set before the discretisation. That involves the Dynamic time warping (DTW) (Sankoff and Kruskal
expertise of data scientists since the settings may change in et al., 1983). It uses dynamic programming to align
different datasets. the time series to minimise distance (Bellman and
Stuart, 1962; Sakoe and Chiba, 1978; Silverman and
Morgan, 1990). With the time series using PAA
segments, the algorithm uses a variation (Piecewise
dynamic time warping, ePDTW). It finds the align-
ment by stretching or shrinking the time series along
the time axis, warping them non-linearly (can be used
to find similarity regions). Distance is the accumula-
tion of local distances between corresponding ele-
ments.
A significant drawback is that the user must choose a
compression rate for the dimensionality reduction.
Fig. 3. Granularity effect. (a) If the reduction scale is large (n/w), the (2) qssi:
chance of information loss increases. (b) if it is small, the PAA segments
Qualitatively Sequence Similarity Index (qssi)
show noise and do not adequately reduce dimensionality.
algorithm matches similar items (Cuberos et al.,
2002). Allows greater flexibility by formulating the
Several authors have adopted SAX since its creation. With
alignment in terms of similarity rather than in terms
the symbolic representations, PCA enables the reduction to
of the distance between sequences. Not aligning the
1-dimensional time series and find the characteristic
sequences over the full length, makes the algorithm
patterns (Tanaka et al., 2005). Minimum Description
faster.
Length (MDL) has been used to extract the most frequently
occurring pattern over SAX sequences (Lin et al., 2001).
QSSI - vital signs, proposed in this work, uses as mainframe
Using PLA to compare patterns in a postprocessing step
QSSI to generate an algorithm specially designed for
with SAX-representations has good results (Hung and Anh
psycho-physiological signals, enabling to perform
et al., 2007).
classification over multiple signals at a time for the same
stimulus. The algorithm needs a series of parameters for
2.4 Distance Sequence Classification SAX representations specially tested to reinforce the
There is no learned principle to mine time-series data in an model, adapting it to the type of signals.
efficient way. Calculating the distance between two time-
series could be costly due to dimensionality. Extraction of One-nearest-neighbour classification and svm are not
symbolic representations enables efficiency while still enough if several psycho-physiological signals need to be
gathering primary information. combined to avoid drawbacks of emotional data. Therefore,
Euclidean, Hamming or Manhattan distance measurements new classification methods are proposed, based on a
are sensible to distortions in time, making them unreliable consensus analysis over the classification of the different
when comparing sequences. signals to give a final result.
(2) Estimation of phylogenetic guide tree based on a classification that would be reduced if the classification
distance matrix was binary.
(3) Progressive global alignment according to a
guided tree 3.1.2 ECG analysis
(4) Guided tree reestimation and realignment Studies show that Heart Rate Variability and Power-Spec-
(5) iterative refinement tra-Density (PSD) analysis are correlated with the effect of
(6) Post-processing and visualisation. emotions and are able to characterise physiological ill-
nesses such as depressions or panic-disorders (McCraty et
Global sequence alignment uses the NW algorithm al., 1995). Heart rate (HR) and Heart Rate Variability
(Needleman & Wunsch et al., 1970) for aligning sequences (HRV) can be extrapolated from electrocardiogram signals
over their entire length to build up an optimal alignment using a MAX30100 Pulse Oximeter.
using previous solutions for alignments of smaller subse-
A MAX30100 Pulse Oximeter filter has been tested. The
quences. The algorithm uses dynamic programming
algorithm uses “mean-median filter” along with a “dc re-
(Gusfield et al., 1997) to find alignment maximising the
moval” to produce a much smooth signal from which HR
similarity score. can be discretised.
The classification does not improve with the discretisation,
Aligning is stated in terms of transforming sequence A into and the filter has to be improved since it is normalising the
B while using a set of operations. Algorithm rewards match signal in such a way that useful information is being lost.
and penalises indels (insertions/deletions). Producing a
matrix for a posterior trace-back. More research has been 3.1.3 Balancing
carried out to create gap-costs that allow block insertions
Balancing does not produce better results. In all the datasets
and deletions (Gotoh, 1982; Sankoff & Kruskal,1983) there is an oversampling of class “1”, neutral. Probably,
there is more probability for a stimulus to produce a neutral
MSA_2 uses Multiple Sequence Alignment as a mainframe.
response than to give an empowered or lowered response.
For each signal, sequences are separated regarding their
class. A database of aligned sequences is computed for each For that reason, when balancing with a subsampling, get-
class (alignment profile). For each query, the sequence is ting rid of useful information (is more likely for a specific
aligned to each class MSA profile and computes the simi- stimulus to give a neutral response) produces worst results.
larity. Class is inherited from the class profile giving the
minimum similarity measurement. Afterwards, a consensus
3.2 Results of QSSI algorithm
analysis is performed between all signals.
The percentage of error produced by the QSSI algorithm for
single signals with a one-nearest neighbour classifier shows
3 Results and Discussion randomness in almost all the classifications (results over
A number of experimental methods have been carried out 0.66, as the method has three classes (see Table 1).
to test the different steps of the methodology.
Results are shown in table 6 and 7. Best results are achieved Fig. 6. Vocabulary length effect. Error in Arousal prediction for different
using that technique, demonstrating that the main source of vocabulary effects.
noise responses differences between individuals. The better
predictor in all cases is QSSI-vital signs with knn majority Figure 6 shows the result of analysing the impact of differ-
voting (using as k=35) ent vocabulary sizes, from 4 to 8 symbols. There is no ap-
parent effect of the length of the vocabulary on the predic-
tions (for different predictions and different signals there is
Table 6. % error on participant data using EpDTW distance measure- not a significant relevance).
ment.
QSSI-1nn QSSI-vs-Knn-MJ QSSI-vs-Knn-AG MSA_2 3.7.2 PAA effect
Best results are achieved using PAA segments of 64. Since
Arousal 0.52343 0.4843 0.625 0.7096
Dominance0.5859 0.42128 0.6718 0.6826
Data is downsampled to 128hz, segments on 64 still gather
Liking 0.61718 0.46875 0.67187 0.625 essential information while reducing substantially the di-
Valence 0.648437 0.515625 0.67187 0.6774 mensionality getting rid of the granularity problem.
3.7.3 k effect
The k effect demonstrates the hypothesis that when using
Table 7. % error on participant data using QSSI distance measurement. individualised data, the results are better than using as a
train and test the whole dataset.
QSSI-1nn QSSI-vs-Knn-MJ QSSI-vs-Knn-AG MSA_2
Ghandeharioun, A., Fedor, S., Sangermano, L., Ionescu, D., Alpert, J., Dale, C., Son-
tag, D., Picard, R. "Objective assessment of depressive symptoms with machine
learning and wearable sensors data," International Conference on Affective
Computing and Intelligent Interaction (ACII), San Antonio, Texas, October
2017
Pei J., Han J., Mortazavi-Asl J., Pinto H., Chen Q., Dayal U., Hsu M., “PrefixSpan:
Mining Sequential Patterns Efficiently by Prefix-Projected Pattern Growth”,
17th International Conference on Data Engineering (ICDE), April 2001.
Agrawal R., Srikant R., “Mining sequential patterns”, Proceedings 1995 Int. Conf.
Very Large Data Bases (VLDB’94), pp. 487-499, 1999.
Han J., Dong G., Mortazavi-Asl B., Chen Q., Dayal U., Hsu M.-C., ”Freespan: Fre-
quent pattern-projected sequential pattern mining”, Proceedings 2000 Int. Conf.
Knowledge Discovery and Data Mining (KDD’00), pp. 355-359, 2000.
Erken, Eray. How to Measure Heart Rate with MAX30100 Pulse Oximeter. 30 April
2016. https://www.youtube.com/watch?v=36cELpNGJZYHow to Measure
Heart Rate with MAX30100 Pulse Oximeter (accessed December 1, 2016).
Maxim. “Pulse Oximeter and Heart-Rate Sensor IC for Wearable Health.” MaximIn-
tegrated. September 2014. https://datasheets.maximinte-
grated.com/en/ds/MAX30100.pdf (accessed November 18, 2016). Sang
Strogonovs, Raivis. "Implementing Pulse Oximeter Using MAX30100 - MORF -
Coding And Engineering". Morf.Lv, 2019,.
McCraty, Rollin et al. "The Effects Of Emotions On Short-Term Power Spectrum
Analysis Of Heart Rate Variability". 1995.
Pous, Carles et al. “Modeling Reuse On Case-Based Reasoning With Application To
Breast Cancer Diagnosis.” 2019.
Henriques, Rui et al. “Seven Principles to Mine Flexible Behavior from Physiologi-
cal Signals for Effective Emotion Recognition and Description in Affective In-
teractions.” PhyCS (2014).
H. Xiong et al. “A brief survey on sequence classification.”. SIGKDD Explorations
(2010).
Espinosa-Carrasco, Jose et al. Pergola: Boosting Visualization And Analysis Of Lon-
gitudinal Data By Unlocking Genomic Analysis Tools. 2019.
Koelstra, Sander. "DEAP: A Dataset For Emotion Analysis Using Physiological And
Audiovisual Signals". Eecs.Qmul.Ac.Uk, (2019),
http://www.eecs.qmul.ac.uk/mmv/datasets/deap/.
Gamero Argüello, Fco. Ignacio. "Pattern recognition based on qualitative represen-
tation of signals. Application to situation assessment of dynamic sys-
tems". Dugi-Doc.Udg.Edu, 2019, https://dugi-doc.udg.edu/bitstream/han-
dle/10256/7039/tfiga.pdf?sequence=5.
Aamodt, A., & Plaza, E., (1994). Case-based reasoning: Foundational issues, meth-
odological variations, and system approaches. AI Communications. Retrieved
from http://iospress.metapress.com/index/316258107242JP65.pdf
Ang, H. H., Gopalkrishnan, V., Zliobaite, I., Pechenizkiy, M., & Hoi, S. C. H. (2013).
Predictive Handling of Asynchronous Concept Drifts in Distributed Environ-
ments. IEEE Transactions on Knowledge and Data Engineering, 25(10), 2343–
2355. https://doi.org/10.1109/TKDE.2012.172
Result of the different algorithms on unbalanced data set with QSSI and EpDTW measurements. [% error of prediction, the blue
line is the random threshold, the red line is lower prediction error]
Annexe, plot 2.
Result of the different algorithms on balanced data set with QSSI and EpDTW measurements. [% error of prediction, the blue
line is the random threshold, the red line is lower prediction error] .
G. Hernández et al.
Annexe, plot 3.
Result of the different algorithms on balanced data set with QSSI and EpDTW measurements. [% error of prediction, the blue
line is the random threshold, the red line is lower prediction error].
Annexe, plot 4.
Result of the different knn algorithms for different k in the unbalanced dataset. [k value ranges from 1 to 128, algorithms are knn-
majority voting and knn-aggregational voting].
Emotional analysis prediction
Annexe, plot 5.
Result of the different knn algorithms for different k in the balanced dataset. [k value ranges from 1 to 128, algorithms are knn-
majority voting and knn-aggregational voting].
Annexe plot 6.
Result of the different knn algorithms for different k in participant data set. Average of the 32 participants. [k value ranges from
1 to 36, algorithms are knn-majority voting and knn-aggregational voting].