Relationship between electrocardiogram‐based features and personality traits: Machine learning approach

Abstract Background Based on the known relationship between the human emotion and standard surface electrocardiogram (ECG), we explored the relationship between features extracted from standard ECG recorded during relaxation and seven personality traits (Honesty/humility, Emotionality, eXtraversion, Agreeableness, Conscientiousness, Openness, and Disintegration) by using the machine learning (ML) approach which learns from the ECG‐based features and predicts the appropriate personality trait by adopting an automated software algorithm. Methods A total of 71 healthy university students participated in the study. For quantification of 62 ECG‐based parameters (heart rate variability, as well as temporal and amplitude‐based parameters) for each ECG record, we used computation procedures together with publicly available data and code. Among 62 parameters, 34 were segregated into separate features according to their diagnostic relevance in clinical practice. To examine the feature influence on personality trait classification and to perform classification, we used random forest ML algorithm. Results Classification accuracy when clinically relevant ECG features were employed was high for Disintegration (81.3%) and Honesty/humility (75.0%) and moderate to high for Openness (73.3%) and Conscientiousness (70%), while it was low for Agreeableness (56.3%), eXtraversion (47.1%), and Emotionality (43.8%). When all calculated features were used, the classification accuracies were the same or lower, except for the eXtraversion (52.9%). Correlation analysis for selected features is presented. Conclusions Results indicate that clinically relevant features might be applicable for personality traits prediction, although no remarkable differences were found among selected groups of parameters. Physiological associations of established relationships should be further explored.


| INTRODUC TI ON
Electrocardiography (ECG) is a non-invasive clinical technique for monitoring electrical heart activity in cardiovascular diagnostics.
Recently, the rich collection of non-traditional applications of ECGbased parameters emerged despite partial or incomplete comprehension of their relevance (Chen, 2018).
In this study, we explored the relationship between ECG-based parameters and personality traits, that is, stable patterns of emotion, motivation, cognition, and behavior (DeYoung, 2015). The most influential, contemporary models of personality postulate the existence of five (McCrae et al., 2005), six (HEXACO, Ashton et al., 2004), or seven broad traits (recently proposed by some authors, such as (Ashton & Lee, 2020;Knezevic et al., 2017)) subsuming many narrower ones in the lower level of hierarchy. These traits are found to be universal in humans (McCrae et al., 2005) and subhuman species (Gosling & John, 1999), longitudinally stable, with about 40% of their variability heritable (Vukasović & Bratko, 2015).
Available evidence indicates that personality traits have profound relationships with peripheral physiology. A modular influence of brain structures implicated in personality traits, such as orbitofrontal and insular cortex, amygdala, hippocampal formation, and hypothalamus (Deckersbach et al., 2006;Depue & Collins, 1999;Koelsch et al., 2007;Panksepp, 1998), seems to be responsible for these relationships. In addition, data show connections between personality traits and peripheral organs and tissues through the autonomic, endocrine, and immune systems (Cloninger, 2000;Depue & Collins, 1999;Irwin, 2008). Therefore, due to the well-known and established influence of the autonomic nervous system on ECG, finding the connection between ECG signal and personality traits seems promising.
Available evidence showed that heart rate decreases and heart rate variability (HRV) increases with Extraversion (Brouwer et al., 2013), Neuroticism correlates with QT interval (Minoretti et al., 2006), and Agreeableness correlates with P, QRS, and T amplitude (Koelsch et al., 2012). Typically, the relationship between personality traits and physiological measures is investigated descriptively, that is, using correlations (Koelsch et al., 2007) or by trying to predict cardiac output with scores on personality questionnaires.
We used the supervised machine learning (ML) approach to examine this relationship. ML is a computer algorithm that automatically assigns traits to the input set of ECG-based features by going through the training and testing phase. The training phase is used for constructing an optimal model that learns from the available ECG features and corresponding traits, while the testing phase is used to evaluate ML performance. Here, we adopted random forest (RF) ML algorithm for trait classification and feature selection as it achieved high prediction accuracy in similar ECG-based investigations (Dissanayake et al., 2019;Melillo et al., 2015) and it is suitable for processing a large number of variables with complex interactions (Breiman, 2001;Strobl et al., 2009).
Random forest ML was applied on ECG-based features with proven clinical efficacy in diagnostics, that is, clinically relevant features (Electrophysiology, 1996;Wagner et al., 2008) and on other parameters due to their attractive and practical characteristic as they are calculated from the local ECG extremes being more robust to noise than standard clinically relevant parameters (Arteaga-Falconi et al., 2016;Cabra et al., 2018) and have proven efficacy in previous studies (Cabra et al., 2018;Israel et al., 2005;Sansone et al., 2013;Shen et al., 2010).

| Aim of the study
We test a novel approach for extracting ECG-based features related to personality traits with RF ML algorithm applied on 62 ECG-based parameters and investigate perceptible changes within intervals of parameters in healthy individuals, to detect the possible relationships between ECG and individual differences in personality traits. An exploratory analysis of ECG-based feature selection is presented.

| ME THODS AND MATERIAL S
Electrocardiogram data analyzed in this study were recorded for another project aiming to investigate emotions and affects by the means of physiological measurements (Bjegojević et al., 2020). We used baseline recording of 120-s long ECG segment recorded in sitting position before the emotion induction to avoid subjects' emotion influence.

| Study sample
The sample consisted of 71 university students, average age

| Recording procedure
Upon arrival, all respondents were introduced to the study and fitted the BIOPAC sensors (Biopac Systems Inc.) (Bjegojević et al., 2020). Subjects were seated and instructed to relax with eyes open and to avoid movements as much as possible to reduce the artifacts. ECG signals were visually inspected for quality on site.
All subjects were blinded for the ECG signal and related parameters. Personality measures were collected separately, before physiological measurements.
Electrocardiogram signals were recorded from standard bipolar Lead I using the BIOPAC MP150 unit with AcqKnowledge software and ECG 100C module with surface H135SG Ag/AgCl electrodes (Kendall/Covidien). Before electrode placement, the skin was cleaned with Nuprep gel (Weaver & Co.) to reduce skin-electrode impedance. The sampling frequency was set at 2000 Hz.

| ECG preprocessing and feature extraction
The complete procedure of ECG preprocessing and feature extraction is described in Boljanić et al. (2021). Computed ECG peak locations and corresponding absolute peak amplitudes were employed for extracting three groups of clinically relevant and clinically nonrelevant features based on the HRV, temporal parameters, and relative amplitude.
We used three domains to calculate HRV-based features: time, frequency, and geometry. The overview of HRV-based features is displayed in Table 1 together with the relevant references related to its application and calculation. All HRV-based features were classified as clinically relevant features, except for the HRV index, as it has been defined and consequently used for 24-h ambulatory ECG monitoring and not for short-term recordings of 2-min duration as applied here (Cripps et al., 1991;Kouidi et al., 2002).
Therefore, we applied RF ML on all features with and without the HRV index.
The overview of extracted temporal features is displayed in Table 2.
The overview of extracted amplitude-based features is displayed in Table 3. The Ek parameter has been suggested as a cardiac signature of emotionality and personality in previous studies (Koelsch et al., 2007(Koelsch et al., , 2012. It presents a weighted linear relation of ECG amplitudes unrelated to the person's BMI with a direct correlation with Emotionality. Thus, higher Ek indices correspond to higher Emotionality measured by the Revised Toronto Alexithymia Scale (Taylor et al., 1992) and vice versa. Originally, Ek indices are determined from the 12-lead resting ECG (Koelsch et al., 2007(Koelsch et al., , 2012. By carefully studying the proposed Ek and its practical significance (BMI and electrode positioning compensations), we concluded that Ek can be calculated for one-channel ECG.
The ECG signal with marked time distances and amplitude differences is shown in Figure 1.

| Analytic strategy
We applied RF ML separately for each personality trait. As psychological test results ranged from 1 to 5, to perform classification and test our hypothesis on a more distinctive personality scores grouping, we used the following reasoning for splitting data: 1 for 1.00-1.50, 2 for 1.51-2.50, 3 for 2.51-3.50, 4 for 3.51-4.50, and 5 for 4.51-5.00. The distribution of classes is presented in Figure 2.
Random forest is an ensemble ML algorithm, consisting of basic models called decision trees where the predictions of all individual trees are combined. Each tree returns a predicted class for the same classification problem and the class that most trees vote for is returned as the prediction of the ensemble and as the final outcome of the algorithm. RF also enables the calculation of feature importance by counting the number of times each variable is selected by all individual trees in the ensemble termed feature importance. Unlike other nonlinear classifiers, RF ML is robust to over-fitting (working perfectly well on a small dataset and poorly on a more general dataset) and yields good classification results even without extensive tuning of the algorithm parameters (Breiman, 2001;IJzerman et al., 2016;Shen et al., 2007;Zhou et al., 2019). RF ML was also used to estimate variable importance.
Parameters were split into three groups and RF was applied on all parameters with (62 overall) and without HRV index (61), and on clinically relevant parameters (34). By clinically relevant parameters, we observed HRV-based features except for the triangular index (16), temporal features (8 × 2), and Ek (2). Each dataset was divided into a training and a testing set (75% and 25% of data, respectively (Attia et al., 2019)). We used R function createDataPartition that randomly splits the data taking into the class distribution balance. We further applied 10-fold cross-validation on the training set using trainControl function that provided an overall accuracy estimate (Ross et al., 2009).
For RF ML application, we tuned decision trees used in the forest (ntree) and random variables used in each decision tree (mtry) by application of tuning Caret procedure to minimize parameters effect on the final accuracy (Brownlee, 2016). We reported mean classification accuracies and confident intervals.
For personality traits with accuracies ≥75%, the first 10 feature importances were plotted for three sets of parameters. We used the varImp function from the Caret package for ranking features by importance. Furthermore, to assess the degree of association between the test scores (both original and mapped into categories) and the top 10 features as in Melillo et al. (2015), we used the Spearman correlation coefficient and calculated the statistically significant correlations as suggested before (Koelsch et al., 2007;Minoretti et al., 2006). p Values were set to .05, .01, and .001.

| RE SULTS
Descriptive statistics for all personality measures are shown in Table 4.
In Table 5, mean classification accuracies when 10-fold crossvalidation of RF ML algorithm was performed with 95% confident intervals for all seven personality traits when all features and only clinically relevant features were used are presented. Classification accuracies for the special case (without HRV index) are also presented (Table 5).
The top 10 feature importances are presented for Disintegration and Honesty/humility in Figure 3. Statistically significant Spearman correlations between scores of personality traits and top 10 features are reported in Figure 3 together with the correlation sign. Only statistically significant correlations with p < .05 and p < .01 were found ( Figure 3). For Disintegration, significant (p < .05) negative TA B L E 1 Heart rate variability (HRV)-based features for three feature domains (time, frequency, and geometry) with corresponding units and related references  (2004), Electrophysiology (1996), Kim and Andre (2008), Tulppo et al. (1996) Standard deviation of differences between adjacent RR intervals HRV index Time n.u.
Abbasi (2004), Cripps et al. (1991), Electrophysiology (1996), Kouidi et al., 2002) HRV triangular index -integral of the density distribution (the number of all RR intervals) divided by the maximum of the density distribution at a discrete scale of 1/fs bins, where fs is a sampling frequency

| DISCUSS ION
In presented study, RF ML approach success varied across personality traits: from 31.3% (being less than the probability of coin flips) for Emotionality to 81.3% for Disintegration (Table 5). The highest classification accuracy was obtained for Disintegration (mean accuracy of 81.3%) and for Honesty/humility (75.0%) for all feature sets (Table 5). This "robust" result to the feature set might be the consequence of the distribution of subjects across categories for traits in Figure 2 (we assessed personality traits only in university students, known to have higher Openness and lower Disintegration).
We used a considerably large list of features providing a more general approach by selecting the most influencing features. Our feature list is exhaustive, and there are many correlated features such as hf and hfnu, so the feature importance list based solely on RF should be taken with precaution. Previous studies have shown that multicolinearity does not affect the classification accuracy 1 , but does influence feature importances (Strobl et al., 2008;Toloşi & Lengauer, 2011). This is in line with our results as the feature importance instability is visible in Figure 3 for 61 and 62 parameters. We used both Spearman correlation coefficients and importance plots to discuss selected features appropriately.
Recently, QT variability index (QTVI) was previously compared with Anger and Hostility traits in patients with implantable cardioverter defibrillator patients had significantly higher QTVI than controls (Krantz et al., 2021). We found a statistically significant negative correlation between the Disintegration category and QTnorm_mean which was not expected as QT interval duration which reflects the time for ventricular recovery increases with Neuroticism (Minoretti et al., 2006). This disagreement might be a consequence of categories distribution (Figure 2), which could have caused a spurious correlation. More likely, these discrepancies might be the consequence of the different methods to assess Emotionality: They used NEO 2 personality inventory (NEO PI-R) (Costa, 1992) to assess Neuroticism, which is conceptually close to Emotionality used here (Fearfulness and Anxiety), but there are important differences: Neuroticism in NEO PI-R has contents related to low Agreeableness (Angry Hostility, and Impulsiveness) and Depression, while Emotionality contains aspects characterizing agreeable persons (Dependability and Sentimentality) without Depression (Ashton et al., 2004). Alternatively, the fact that Neuroticism correlates to some extent with Disintegration (Knežević et al., 2016) might also explain this discrepancy. Though prolongation of QT interval is associated with a variety of acute and chronic cardio-vascular conditions (Campbell et al., 1985), its relationship with personality traits should be further explored.
Another interesting parameter is the HRV index that appeared among the top 10 features for Disintegration (Figure 3), but it was not statistically correlated with this trait. It could be discussed whether the HRV index was calculated properly or it influenced the importance plot as a garbage feature. Interval of 120 s was sufficient for all calculated parameters except for the HRV index being commonly calculated for Holter recordings (Cripps et al., 1991;Kouidi et al., 2002). More in-depth analysis in our study revealed that the found that Honesty/humility was positively correlated with Pwave_ sd (.196), which is not surprising given the negative correlation between Honesty and Disintegration. P wave reflects atrial conduction delay, and multivariate logistic regression analysis revealed that it is significantly longer in patients with atrial fibrillation (Steinberg et al., 1993). This is probably a consequence of depressed conduction that resulted in prolonged atrial activation and loner P wave. P wave variation was associated with atrial fibrillation in patients (Censi et al., 2016). Higher variability in the P wave indicates changes in atrial conduction, and we can only speculate whether it presents a risk factor for atrial fibrillation in healthy subjects with higher Honesty/ humility and lower Disintegration scores.
For Honesty/humility, we identified in the current study the following important clinical features with positive correlation  Koelsch et al. (2007Koelsch et al. ( , 2012 Calculating formula is available in Boljanić et al. (2021) Abbreviations: MNUA, Mentioned in literature not used for analysis; n.u. no unit. The prolonged ST segment is related to the increased Honesty/humility score. ST segment presents interval between ventricular depolarization and repolarization. Prolonged ST segment in the absence of Q wave in a case study was related to the heart tumor (Hartman, 1982).

F I G U R E 1
However, there is no stronger evidence on psychophysiological bases of ST duration. As lfnu, hfnu, and lfhf are interrelated, the positive correlation with hfnu and negative with lfnu and lfhf were expected.
Lfhf ratio reflects the autonomic balance of the sympathetic and parasympathetic parts of the autonomic nervous system, and it has been shown that maturity (being self-directed, cooperative, and selftranscendent) was negatively associated with the lfhf (Koelsch et al., 2012;Zohar et al., 2013). As Honesty/humility assumes more mature behavior, our finding on the negative correlation between Honesty/ humility and lfhf is in line with the previous ones. Higher hf was also found in individuals that were more sensitive to positive states of others indicating more successful maintaining of social relationship with pronounced parasympathetic activity (Lischke et al., 2017).
Overall, though physiological basis of adoption of clinically relevant parameters exist, the exact and the most influential parameters in relation to specific personality trait are yet to be discovered as the current base of knowledge is vastly related to clinical conditions. We believe that this study provides a perspective in ECG-based features potential for studying personality traits in relation to ECG parameters changes within healthy ranges, as well as for further investigation personality traits in individuals with cardio-vascular diseases.
Once the relationships are clearly determined, we may be able to answer whether individual traits present risk factor for cardio-vascular condition or vice versa, or the relationship is of a different origin and complexity.
For nonclinical features, we identified positive correlations of Honesty/humility with RT.ampl (.135) and negative with RQa.sd of −.324 (Figure 3). RT.ampl and RQa.sd have been previously used and proposed for person identification. No known physiological basis for their explanation exists, although we observed that a higher R peak concerning the T peak and lower variability of R and Q peaks yields to increased Honesty/humility. Distances between local extrema on ECG signal are termed amplitude and temporal distances (Arteaga-Falconi et al., 2016;Cabra et al., 2018;Israel et al., 2005), and though there is no clear clinical rationale for the application of these parameters, we computed them due to the demonstrated results (Shen & Tompkins, 2005). Our results ( to 20.1%. The unreserved advantage of clinical features is in their proven relation to physiological processes, but the potential of clinically not relevant features should not be forsaken.
We identified the following limitations of the study: 1. We used RF ML due to its proven efficiency for emotion recognition and prediction of cardiovascular events when classifying ECG-based features (Dissanayake et al., 2019;Melillo et al., 2015). A careful selection of the most appropriate algorithm should be performed.
2. Additional data from the general population and especially from an independent cohort are needed for further confirmation of presented associations between ECG-based parameters and personality traits, although our results present a firm base for future

| CON CLUS IONS
The main contribution is an enhanced body of knowledge regarding the relationships between ECG-based features and personality traits (HEXACO model complemented with Disintegration trait) based on a novel analytical strategy-machine learning.
Random forest ML and Spearman's correlations allowed us to formulate associations out of a large number of ECG-based features indicating the following statements that should be re-confirmed: 1. higher Honesty/humility is directly related to the lower lfhf ratio suggesting that more mature behavior and fairness in dealing with others is related to more pronounced vagal tone, 2. less Extraverted persons could be more prone to cardiovascular diseases as revealed by the HRV triangular index, and 3. Disintegration (proneness to psychotic-like experiences/behaviors) was found to be related to QT interval duration and P wave variance, as well as HRV.

Replication of presented findings especially with the focus on
Disintegration and Honesty/humility in an independent cohort would be a highly welcomed first step toward the development of more explanation-oriented (neural) theories and studies. Our results include open data as well as open and free software for further in-depth exploratory investigation, replication, and future metaanalysis (Boljanić et al., 2021).

CO N FLI C T O F I NTE R E S T
None. Writing-review and editing.

E TH I C S S TATEM ENT
The study was approved by the Institutional Review Board of the

DATA AVA I L A B I L I T Y S TAT E M E N T
The raw data that support the study findings were recorded at the 1 We reconfirmed this statement as suggested by reviewer. We applied principal component analysis (PCA) prior to RF ML and showed that classification accuracies were higher only in two cases (~6% higher with relatively low resulting classification accuracies of 56.3% and 62%) for all traits and all three datasets when only 10 principal components were used as RF ML input.
2 NEO inventory was named after acronym of the three-factor personality model including Neuroticism, eXtraversion, and Openness personality traits, but now it covers two additional factors Agreeableness and Conscientiousness and is used to present fivefactor model.