{'fraction_non_alphanumeric': 0.02963254851738745, 'fraction_numerical': 0.009496601320066989, 'mean_word_length': 5.252278886425228, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 2, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Cognitive State Analysis, Understanding, and Decoding from the Perspective of Brain Connectivity

Cognitive states are involving in our daily life, which motivates us to explore them and understand them by a vast variety of perspectives. Among these perspectives, brain connectivity is increasingly receiving attention in recent years. It is the right time to summarize the past achievements, serving as a cornerstone for the upcoming progress in the field. In this chapter, the definition of the cognitive state is first given and the cognitive states that are frequently investigated are then outlined. The introduction of approaches for estimating connectivity strength is followed. Subsequently, each cognitive state is separately described and the progress in cognitive state investigation is summarized, including analysis, understanding, and decoding. We concentrate on the literature ascertaining macro-scale representations of cognitive states from the perspective of brain connectivity and give an overview of achievements related to cognitive states to date, especially within the past ten years. The discussions and future prospects are stated at the end of the chapter.


Introduction
Cognitive state is defined as the state of a person's cognitive processes in a dictionary. It reflects the underlying mental action and process related to a wide range of cognitions such as memory, attention, evaluation, reasoning, problem-solving, comprehension, and language organization. Therefore, cognitive state assessment endows to probe into cognition and be aware of brain state. Questionnaire-based assessment is a quick and easy way to gauge cognitive state with the advantages of low cost and unlimited accessibility. This method is useful and effective to assess quite stable cognitive statuses originated from pathological conditions such as dementia because the cognitive ability is almost not affected by subjective factors. For instance, the questionnaires of Mini-Mental State Examination (MMSE) [3] and Montreal cognitive assessment (MoCA) [4] are prevalently utilized to assess cognitive capability and to detect cognitive decline. However, questionnaire-based assessment is not very applicable to measure cognitive states which could vary in a short period. Another drawback of the use of questionnaire-based assessment is the incapability of a real-time evaluation. It depends on the recall of past engagement and is largely affected by subjective factors. In contrast, the assessment based on neurophysiological signals provides an objective evaluation of cognitive states and can perform a real-time evaluation, but this comes at the expense of high cost and is restricted by the availability of measuring equipment and a trained operator. To date, a variety of neurophysiological signals have been being utilized to assess diverse cognitive states. The signals encompass time series modality (e.g., electroencephalogram (EEG), magnetoencephalogram (MEG)) .. What modality is adopted depends on the need of an experiment and the purposes of a study. They can be either individually adopted or jointly adopted. This figure incorporates some parts of images from the Google Images with labelling the permission of reuse and some parts of images from [1,2] with permissions given by Elsevier and Springer. and image modality (e.g., functional magnetic resonance imaging (fMRI), diffusion tensor imaging (DTI)). These signals are analysed (analysis) or decoded (classification) to understand human cognitive states (see Fig. 1.1). For the analysis, the objective is to find intrinsic characteristics that are associated with a given cognitive state or to reveal representative differences between different levels of a cognitive state or between different groups (e.g., patient group versus healthy group). The resultant findings from the analysis could inform feature extraction in the classification so that informative and discriminative features can be extracted to facilitate the classification. . .

Inter-Brain
Inter-Region by electrode by anatomical atlas Connectivity Figure 1.2: Illustration of the main flowchart for the analysis and classification of cognitive states. The signals recorded from the human are processed to remove interferences and retain cognition-related information. The processing steps and methods vary for different modalities. The critical processing steps for three modalities are delineated in the panel of signal processing. Connective strengths between brains (inter-brain) or between brain regions (inter-region) are estimated by an approach listed in the hexagon to construct a connectivity network. Subsequently, analysis and classification are performed based on the connectivity network. The findings revealing brain connectivity representations related to cognitive states are presented in the analysis studies while the classification accuracies are reported in the classification studies. No matter a study is for analysing and/or decoding cognitive states, a signal measured from a specific location can be considered the proxy of brain activity of that location. In general, signals are recorded from the human by placing measuring electrodes or sensors at the targeted locations or scanning a particular body part. The recorded signals should be first processed to remove interferential components (i.e., artifacts). For different signal modalities, the processing of artifact removal varies. The general and critical processing steps and methods for three frequently-adopted modalities were shown in the panel of signal processing in Fig. 1.2. After the artifact removal, individual regions are separately explored to investigate cognitive states, which was done by numerous studies. In this way, brain regions are isolated when exploring characteristics relevant to the cognitive state. However, brain regions cooperate together to perform a task while they might dominantly contribute to a particular function required in the task. Therefore, the exploration of interregional interactions in the brain is necessary to account for the cooperation. A vast range of approaches can be utilized to estimate the interregional interactions in terms of connectivity strength (see the approaches enclosed in the hexagon in Fig. 1.2). Subsequently, cognitive states are explored based on the connectivity. To date, researchers have accomplished some achievements and made progress in the investigation of cognitive states from the perspective of brain connectivity. We summary these achievements in this chapter to give an overview of the progress. Due to diverse cognitive states and ambiguous boundaries among cognitive states, we, in this chapter, focus on mental fatigue, mental workload, vigilance, and emotion, which have relatively frequently ascertained and reported in the literature. The remainder of the chapter is organized as follows. We describe approaches used for estimating connectivity strength in the next section. This is followed by the sections stating the details of achievements in mental fatigue, mental workload, vigilance, and emotion. In section 1.7, toolboxes used for brain connectivity analysis and classification are introduced. After that, thoughts and further directions are drawn in section 1.8. Finally, a conclusion is given in section 1.9.

Methods for Connectivity Strength Estimation
Connectivity is a representation of relationships between brain regions or between channels. The extent of interactions between regions or between channels is quantified by the methods estimating connectivity strength and is then represented as a connectivity matrix. Subsequently, the following analysis or classification based on the connectivity matrix (i.e., comprising connectivity strengths of all pairs of brain regions or channels) can be conducted to reveal brain connectivity patterns or to detect cognitive states or brain diseases. The methods frequently used for estimating connectivity strengths are detailed below.

Phase Locking Value
Phase locking value (PLV) shows how two signals measured from two separate brain regions synchronize in the phase. Let s k (t) and s l (t) indicate signals measured from brain regions k and l, respectively. The analytical representations of s k (t) and s l (t) are obtained by the Hilbert transform, expressing as [7,8,9] (1.1) Phase differences at each time point are then calculated by Subsequently, the PLV between the brain region k and the brain region l is obtained by averaging over all time points where n t is the number of time points. PLV is within the range [0, 1] with 1 reflecting perfect phase synchronization between brain regions and 0 reflecting no phase synchronization. The PLV calculation is repeated for all pairs of brain regions. After that, all PLVs are assembled to form a connectivity matrix.

Phase Lag Index
When PLV is applied to EEG signal, spurious correlations between EEG signals are introduced into connectivity estimation due to that EEG signals from nearby electrodes are very likely to record the same brain activity source (a.k.a., common source). This is referred to as volume conduction. If two signals measure the same source, their phases should be well coupled. Therefore, a consistent and non-zero phase lag between signals cannot be attributed to that the signals are from the same source. The method measuring consistent and non-zero phase lag is called phase lag index (PLI) [10]. PLI can be calculated based on phase differences at each time points ∆φ k,l (t), t = 1 · · · n t by where · denotes the mean averaged over time, |·| denotes the absolute value, and sign stands for signum function. Similar to the PLV, PLI value ranges from 0 to 1. A value of 0 reflects either no synchronization or phase synchronization difference centered around 0 and π while a value of 1 reflects perfect phase synchronization with consistent phase difference other than 0 and π [10].

Wavelet Phase Coherence
Let φ x (t, f ) and φ y (t, f ) be phases at time point t and frequency f for signals x(t) and y(t), respectively. The phase difference can then be calculated by Wavelet phase coherence is defined in terms of cos ∆φ(t, f ) and sin ∆φ(t, f ) where · denotes the mean averaged over time [11].

Pearson Correlation and Cross Correlation
Pearson correlation is a quantity measuring how a signal x(t) correlates with another signal y(t), defined as

COGNITIVE STATE ANALYSIS, UNDERSTANDING, AND DECODING FROM THE
where µ x and µ y are means of signals x(t) and y(t), respectively, and σ x and σ y are their corresponding standard deviations.
In the studies with fMRI, Pearson correlation is frequently adopted to estimate functional connectivity between voxels or between atlas-based regions or from a seed region to all other regions.

Mutual Information
Mutual information between two signals is defined as [13] where H(x) and H(y) are Shannon entropies of signals x(t) and y(t), respectively, and H(x, y) is joint entropy.

Granger Causality
The aforementioned methods estimate connectivity strength for a pair of brain regions at a time. Besides, multivariate autoregressive (MAR) model can be employed to simultaneously estimate relationships among more than two brain regions. Suppose that there are N signals, representing X = [ x 1 x 2 · · · x N ] T . The current values at each signal are dependent on the past values at each signal, modelling as where W = [ w 1 w 2 · · · w N ] T is white uncorrelated noise and p is order of the MAR model. The model order p can be determined by model quality assessment such as Akaike information criterion (AIC) [14]. The AIC makes a good balance between the goodness of fit of the model and the model simplicity. A r , r ∈ {1, 2, · · · , p} are N × N coefficient matrices for each lag r.
The element a ij (r) in the coefficient matrix A r describes linear prediction effect of the rth past value x j (t − r) of the signal x j (t) on predicting x i (t). if any a ij (r) = 0, it means that x j (t) Granger-causes x i (t) [15]. It is worth noting that x j (t) Granger-causing x i (t) does not mean that x i (t) must Granger-cause x j (t). It is not reciprocal. Based on Granger causality, a few variants have been developed, which are introduced below.

Ordinary Coherence
MAR model formulated in (1.10) can be rewritten as Equation (1.12) can be transformed into frequency domain as The cross-spectral power density matrix obtained by where the superscript H represents Hermitian transpose, stands for covariance matrix, and Ordinary coherence is defined as [16] C It shows the extent to which brain regions i and j are simultaneously activated.

Directed Coherence
Directed coherence, unlike ordinary coherence merely describing mutual synchronicity, gives both connective strength and connective direction between brain regions. The directed coherence from brain region j to brain region i can be expressed as [17,18,19] γ

Partial Directed Coherence
Partial directed coherence (PDC) from brain region j to brain region i is defined as [20,21] π

Directed Transfer Function
Directed transfer function is defined in terms of H as γ 2 ij (f ) quantifies the fraction of inflow to brain region i stemming from brain regions j [19].

Full Frequency Directed Transfer Function
After the frequency normalization, directed transfer function is transformed into full frequency directed transfer function, expressing as [20]

Synchronization Likelihood
Synchronization likelihood quantifies the extent to which a signal recorded from a brain region synchronized to signals from all the other brain regions. Synchronization likelihood of signal x(t) is defined as [22] w1 and w2 are parameters to determine the time window where data points are included. N is the number of signals, θ() is the Heaviside step function, d() is the Euclidean distance, and x k,i is embedded vector reconstructed with time-delay embedding [23].

Mental Fatigue
Fatigue is divided into two categories: physical fatigue and mental fatigue. We only discuss mental fatigue in this chapter. Mental fatigue is usually caused by excessive demand on brain resource for implementation of mental tasks or prolonged task execution with exhaustive depletion of brain resource or prolonged monotonous task reducing attention retention. As we know, mental fatigue would lead to a decline in brain function, showing inefficient performance, increased error occurrence rate, and incapably continue ongoing task, and so forth. It, sometimes, even results in fatal consequences such as deadly traffic accident [24]. Therefore, understanding neural mechanisms under mental fatigue and characteristics during the transition from wakefulness to fatigue are crucial to inform the development of precautionary measures and prevent adverse consequences stemming from mental fatigue. Up to now, numerous studies have been conducted to reveal mental fatigue-related effects on the human brain. We only collected and listed studies that investigated or classified mental fatigue from the perspective of brain connectivity in Table 1.1 as this chapter focuses on the theme of brain connectivity. The majority of studies analysed either EEG data or fMRI data to explore neural mechanisms in brain connectivity pertaining to mental fatigue [5,25,26,27,28,29,30,31,32,33]. Few others devoted to classifying mental fatigue state using features extracted from EEG signal [34,35], as well as a combination of data analysis and classification [36,37]. The experimental settings, findings derived from studies and classification performances were detailed in the following subsections.

Tasks Conditions in Fatigue Studies
Most frequently, simulated driving is employed to induce fatigue because the task can be well defined and be easily controlled in a simulated environment (see Fig. 1.3). It also has an advantage of safety and participants do not face any risks of physical injury. Responses and task difficulty can be adjusted to meet the requirements of a study. In such a driving simulation experiment, participants usually undergo a certain long time of simulated driving to attain fatigue state [50,34,35,33,37]. A much shorter time is enough when highly demanded attention is involved in tasks such as psychomotor vigilance task (PVT) [32,46]. During the PVT, participants should respond to a counter as quickly as they can and intense attention is required to perform the task. This imposes high mental load on the human brain and swiftly depletes brain resource, which facilitates to induce mental fatigue. Another attention-required task that has been used for fatigue study is visual oddball task [28,29], in which participants are asked to distinguish the target letter from shape-analogous English letters by pressing a predefined bottom. Moreover, other attention-based tasks such as detection of three different odd numbers and responses according to image color and arithmetic calculation such as addition and subtraction have also been utilized for fatigue studies [43]. Besides these laboratory-based experiments, real outdoor driving lasting about 3.5 hours was conducted to explore mental fatigue [48]. In addition, fatigue is investigated not only in healthy people but also in patients. Patients with fatigue symptom are compared to those who have no such fatigue symptom to reveal fatigue effect on diseases (e.g., Parkinson's disease and multiple sclerosis) [25,38,26,31,27,32,45].

Findings Derived from Analysis
Generally speaking, mental fatigue is related to overall low functional connectivity among brain regions. Denser local connectivity (within local communities) and lower long-distance connectivity (between communities) are observed in the state of mental fatigue. These contribute to inefficient connectivity for the whole brain network, resulting in low global efficiency. With relatively dense 64-channel EEG recording, increased clustering coefficient, increased characteristic path length, increased local efficiency, and decreased global efficiency in topological organization of connectivity network after consecutive implementation of a visual oddball task were found [28], suggesting task implementation towards mental fatigue led to more active activity within local areas and fewer interactions between areas. The regional analysis using betweenness centrality revealed that brain regions located in the frontal area appeared drastic changes in the connectivity (see Fig. 1.4). The similar changes in clustering coefficient and characteristic path length were also observed in a study with a simulated driving task [30]. These results demonstrated that different tasks could lead to a similar topological change in brain connectivity network. It is worth mentioning that this is not always the case. In a study using sleep deprivation for inducing fatigue and synchronisation likelihood for estimating brain inter-regional connectivity, the decreased characteristic path length was observed when a longer time for sleep deprivation was administered (more fatigued after the longer time for sleep deprivation) [42]. This discrepancy might be attributed to different methods used for estimating brain inter-regional connectivity and a small number of electrodes (i.e., 19 electrodes) employed for EEG data collection in the study. With a relatively large cohort of 50 participants, Liu et al. found that the coupling among frontal, parietal, and central areas was altered from pre-to postmental task, and has asymmetric changes in hemisphere [43]. The hemispheric asymmetry of functional connectivity was also observed in the frontoparietal area according to the study with PVT task [47]. Using data modality of functional near-infrared spectroscopy (fNIRS), significantly lower wavelet coherence/wavelet phase coherence was observed in the prefrontal cortex in the frequency bands of 0.6∼2 Hz and 0.052∼0.145 Hz and the motor cortex in the frequency band of 0.021∼0.052 Hz after the driving task [49]. The involvement of the frontal area in the mental fatigue was also reported by studies using other modalities such as EEG [33] and fMRI [29]. Taken together, we can see that the frontal area plays an important role in brain connectivity alterations relevant to mental fatigue.
In addition to studies in healthy people, fatigue was usually investigated with diseases. Patients with myalgic encephalomyelitis/chronic fatigue syndrome (ME/CFS) exhibited altered functional connectivity of several regions (e.g., bilateral superior frontal gyrus and precuneus) [25]. The altered extent was correlated with clinical fatigue ratings. This was corroborated by another study from the same group [38]. In the comparison between the group of Parkinson's disease with fatigue and the group of Parkinson's disease without fatigue, it revealed that Parkinson's disease-related fatigue was associated with altered functional connectivity among the right middle frontal gyrus, left insula, and right midcingulate cortex [26]. Finke et al. investigated fatigue in the disease of multiple sclerosis and found that functional connectivity of basal ganglia nuclei with medial prefrontal cortex, precuneus and posterior cingulate cortex was negatively correlated with fatigue severity while the functional connectivity between caudate nucleus and motor cortex was positively Figure 1.4: Betweenness centrality difference between after and before the consecutive visual oddball task. Black dots stand for EEG channels with significant changes and lines represent dominant connections. Red color means the increase after the task while blue color means the decrease after the task. Brain regions residing in the frontal area appeared drastic changes in the connectivity after the task. This figure was reproduced from [28] with the reuse permission under an open licence. correlated with fatigue severity [31]. The association between fatigue in multiple sclerosis and functional connectivity was also discovered from another independent study [39]. According to the research on breast cancer, fatigued patients (i.e., persistent cancer-related fatigue) displayed greater connectivity from the left inferior parietal lobule (IPL) to superior frontal gyrus and lower connectivity from the right precuneus to the periaqueductal gray and from the left IPL to subgenual cortex [27]. As similar use in healthy people, the PVT was utilized to explore fatigue in patients with mild traumatic brain injury. A significant linear correlation between self-reported fatigue and functional connectivity in the thalamus and middle frontal cortex was found [32]. These studies demonstrated that fatigue-related changes in functional connectivity exist with diseases.

Fatigue Classification
One step closer to practical usage is fatigue classification based on functional connectivity. Fatigue levels can be classified and an appropriate warning is given to drivers or operators whose fatigue extent reaches a certain high level. Most of fatigue classification papers aimed to detect driving fatigue in order to eliminate or reduce fatigue-caused traffic accidents [35,34,41,51,52,48]. Others are for the purposes of separation of wakefulness and fatigue states during a task [46]. Connective strengths estimated by the methods presented in the Sect. 1.2 (e.g., PLI and PDC [41]) are usually used as feature candidates. Feature selection is followed to screen feature candidates, retaining discriminative features while excluding those features without value in classification. Feature selection can be done by evaluating individual features separately [53] or considering a subset of features at a time [41] or dimension reduction algorithms [35]. After that, a classifier named support vector machine is frequently employed to classify fatigue levels based on the selected features [41,46,34]. Besides, classifiers, linear discriminant analysis, k-nearest neighbours, sequential minimal optimization, least squares learning, and artificial neural network, have been utilized for fatigue classification [41,34]. Recently, the fusion of connectivity features and power features was proposed to classify driving fatigue [35]. The classification performance was improved as complementary information was taken in the feature fusion. Mostly, k-fold cross-validation is used to obtain classification accuracy. The procedure of the k-fold crossvalidation is as follows: 1. Shuffle samples randomly 2. Split the samples into k groups (e.g., k = 10) 3. Take a group as the testing dataset 4. Take the remaining k − 1 groups as the training dataset 5. Train a model using the training dataset and evaluate the model on the testing dataset 6. Retain the accuracy obtained from the evaluation on the testing dataset and take another group as the testing dataset to repeat above steps 4-5 until each group has been the testing dataset once.

Average accuracies across k groups to obtain final classification accuracy
Each sample is only used in the testing dataset once and used to train the model k − 1 times. The more folds split, the more inflated classification performance. In an extreme case, one sample forms a group. It is called leave-one-out cross-validation (LOOCV). The LOOCV results in an inflated performance, which is an optimistic estimate of classification accuracy. To circumvent this issue, samples should be split into a few folds such as 5-fold and 10-fold [54]. Noting that the number of folds depends on sample size. If samples are more, they could be split into a more number of folds. Due to the truth that classification performance is largely dependent on dataset itself and evaluation setting, classification accuracies reported in different studies cannot be directly compared. Therefore, we do not summary classification accuracies and compare them in this chapter.

Mental Workload
Mental workload is an amount of brain resource paid for task implementation. There has been no clearly universally accepted definition for the mental workload. It is closely related to two determinants: task requirement and human capability or resources [55,56,57,58,59]. Given these two determinants, the mental workload could refer to the portion of information processing capacity or resources that is actually required to meet task demands [56] or mental workload could be viewed as the ratio of the resources demanded for satisfying task performance to the mental capacity a person can supply [59]. Unlike mental fatigue that cannot be changed in a transient period, the mental workload could be modulated instantly. N-back is one of the commonly used tasks to induce different levels of workload by giving different difficulty levels. A study comparing the 0-back and 2-back revealed that a higher functional integration in the theta band and lower functional segregation in the alpha band for the 2-back compared to the 0-back. The regions with significant differences between the 0-back and 2-back mainly resided in the frontal, temporal, and occipital lobes [60]. Functional connectivity research on mental workload has been extended to the dynamic graph, which takes temporal information into consideration when estimating connectivity strengths between brain regions (see Fig. 1.5 for the illustration). Ren et al. found that the higher workload led to a more globally efficient but less clustered dynamic small-world functional network based on dynamic network [61]. Similar to the N-back's principle of that difficulty level is elevated by increasing the information to be remembered, Charbonnier et al.'s study adjusted workload level through changing the length of sequential digits that participants have to remember for correctly making the following judgement [62]. They extracted connectivity features from the selected subset of electrodes and classified workload levels using Fisher's linear discriminant 20CHAPTER 1. COGNITIVE STATE ANALYSIS, UNDERSTANDING, AND DECODING FROM TH analysis (LDA). Moreover, arithmetic was utilized to induce different workload levels by modulating addition difficulty. Five workload levels induced by five arithmetical difficulties were classified by k-nearest neighbours (k-NN) classifier using different feature extraction methods (i.e., tensor subspace analysis (TSA) and LDA) and multiple bands on spatial dependent representations of phase synchronization. According to the report, a combination of TSA and k-NN using coupling features between the theta in the frontal region and the upper alpha (10∼13 Hz) in parieto-occipital region achieved the best performance [63]. In the study of using intelligence quotient test for workload induction, multiple features including connectivity metrics were fed into a neural network to predict workload level [64]. In addition, two different categories of mental tasks were used to induce mental workload. As addressed in [65], N-back (0-back and 2-back) and arithmetic (one-digit number addition and three-digit number addition) tasks were used and both within-category classification and between-category classification were performed. A good performance was obtained for both classification cases. In a recent study, a regression model was used to establish the relationship between functional connectivity features and workload level in a programmer who performed code comprehension and syntax error detection [66]. This model can be used to evaluate the programmer's workload. Besides the tasks with only one participant, workload has been investigated in the case of cooperation between participants. Sciaraffa et al. explored workload among participants who engaged in a collaborative task and found that causality value was higher for those who collaborated more tightly [67].

Vigilance
Vigilance is defined as the ability to maintain concentrated attention and to remain alert to stimuli or targets over prolonged periods of time [68,69]. Vigilance is closely related to fatigue. Fatigue state is accompanied with low vigilance, but the non-fatigue state does not have to be with high vigilance. It has been found that vigilance was relevant to functional brain connectivity [70]. An fMRI study revealed that vigilance was associated with the fluctuations in left amygdala functional connectivity with regions of the salience network [71]. Piantoni et al. used Granger causality to investigate cingulate functional connectivity and found that the forward effective connectivity over the cingulate was related to vigilance [72]. When vigilance is degraded, functional connectivity between brain regions is disrupted [73]. The linkage between functional connectivity and vigilance was also supported by the finding derived from the analysis of dynamic functional connectivity [74]. Because of the relevance between vigilance and functional connectivity, features derived from functional connectivity can be utilised to recognise vigilance. For example, Xie et al. suggested that the information derived from the alpha band networks could be used to predict vigilance level [75]. It has been shown that phase synchrony indices on connectivity network can be used to successfully predict the average hit response time (a measure indicating vigilance) based on deep neural network model (this is a machine learning method) [76]. An extended question might come up. Is it possible to enhance vigilance when it is declined? To this end, some efforts have been done. In the stroop color-word task, participants' vigilance was enhanced when an auditory stimulus was provided according to behavioural and connectivity analysis [77]. The vigilance enhancement could also be attained by visual stimulus [78].

Emotion
Emotion is an affective state of consciousness, which is associated with thoughts, feelings, behavioural responses, and interactions with others [79]. Emotion can be characterized by two dimensions of arousal and valence. It is basically divided into six categories: anger, disgust, fear, happiness, sadness and surprise. Images of facial expressions or videos with emotional components (e.g., sounds) are used as stimuli in experiments for emotion studies. According to a study with a large number of participants (i.e., 586), connective strength was increased from amygdala to the hippocampus during the encoding of positive and negative pictures in relation to neutral pictures. The strength of this connection in the reverse direction showed a smaller elevation [80]. Diseases, such as major depressive disorder (MDD), affect the functional connectivity relevant to emotional stimuli. As indicated in the study of functional connectivity comparison between healthy group and MDD group, greater functional connectivity between the subgenual anterior cingulate cortex and the amygdala and lower functional connectivity between the subgenual anterior cingulate cortex and the insula/putamen, fusiform gyrus, precuneus/posterior cingulate, and middle frontal gyrus were found in the MDD group [81]. A comparison study showed that functional connectivity was obviously different between positive emotion and negative emotion [82]. This suggested that emotion can be recognised based on functional connectivity. As shown in the emotion recognition study, a classifier of quadratic discriminant analysis was used to successfully distinguish different emotional states based on connectivity indices such as between-channel coherence and correlation [83]. The between-channel connective strengths were adopted to distinguish high arousal from low arousal, or positive valence from negative valence by traditional machine learning methods (e.g., support vector machine) [84]. Emotion recognition was also achieved by more sophisticated methods such as graph convolutional neural network [85]. According to recent studies, functional connectivity features were better than power spectral density features in emotion recognition [86]. By combining these different kinds of features, emotion recognition performance can be improved compared to that of using single kind of features [87,88]. It is not surprising because feature combination could provide more information that single kind of features cannot provide. In particular, performance improvement is predominant when different kinds of features are complementary.

Toolboxes for Brain Connectivity Analysis and Classification
We introduce some toolboxes that can be used to facilitate your analysis and classification based on brain connectivity. The toolboxes introduced for classification is universal, rather than only for brain connectivity-based classification. First of all, raw data need to be preprocessed to remove artifacts that are not interesting for the study. EEGLAB [89] is one of the good choices you can choose to accomplish this purpose for time series data (e.g., EEG). It provides variant data import functions for you to import diverse data formats. The accompanying manual guides you step by step to process data. It can be easily used even you are a novice to the EEGLAB. For the fMRI and DTI images, the Statistical Parametric Mapping (SPM) package (http://www.fil.ion.ucl.ac.uk/spm/software), FMRIB Software Library (FSL) [90] can be utilized to process them, respectively. In addition to the self-contained functions in the above toolboxes for connectivity strength estimation, a specialized toolbox, called HERMES, is available at http://hermes.ctb.upm.es/ for strength estimation. It provides a user-friendly GUI to allow users to select methods (refer to Sect. 1.2 for methods) for strength estimation. If you plan to explore dynamic brain connectivity, the toolbox named dynamic brain connectome can meet your need (available at http://www.restfmri.net/forum/DynamicBC). Once a connectivity matrix containing connective strength values for all pairs of channels/brain regions/electrodes is constructed, the brain connectivity toolbox can be utilized to calculate graph theoretical metrics [91]. Please refer to the paper [91] for the definition and interpretation of the metrics. GRETNA is another toolbox to perform topological analysis of brain connectivity [92]. To visualize results derived from brain connectivity analysis, BrainNet Viewer [93] and EEGNET [94] are useful to display resultant connectivity pattern vividly. Besides, FieldTrip [95] is a general-purpose toolbox for the processing, source localization, and analysis of time series data. Support vector machine (SVM) is one of the excellent classifiers with good-balance between performance and complexity. A toolbox named LIBSVM was developed to easily implement SVM with parameter tuning [96]. It can be downloaded at https://www.csie.ntu.edu.tw/ cjlin/libsvm/. You may use Matlab built-in Statistics and Machine Learning Toolbox to perform classification. It contains basic methods for the classification. A comprehensive toolbox for classification including feature selection methods and discriminative methods is the Spider (available at https://people.kyb.tuebingen.mpg.de /spider/main.html). It contains SVM, C4.5, k-NN and so on, as well as regression methods. You may select different methods and compare them in terms of classification accuracy.

Thoughts and Further Directions
Based on the progress of understanding of cognitive states and the development of classification technique for distinguishing cognitive states, it can be seen that neuroimaging data contain abundant information relevant to cognitive states and brain connectivity analysis using invasive recorded data is a feasible manner to reveal neural mechanisms underlying cognitive states. Cognitive state is investigated using experiments, which are designed to induce required mental state while excluding interferential factors as many as possible. However, absolute exclusion seems impossible and special caution should be given when interpreting results. Moreover, artifacts and non-cognitive state background give a confounding effect on findings. Therefore, preprocessing is a critical step before data analysis and data classification for removing the confounding effect. Until now, many preprocessing methods have been developed to remove diverse kinds of artifacts such as EOG originated from eye movements and EMG originated from head movements. The principle behind artifacts removal is that raw data are decomposed into components and components corresponding to artifacts are removed to eliminate artifacts. Independent component analysis (ICA) [97] principal component analysis (PCA) [98] and wavelet transform [99] belong to this category. These methods are developed to process data which have been collected and are not intended to process data in real-time. Nonetheless, some of them have been modified to meet the requirement of real-time processing. For example, ICA method was modified to suit real-time data processing [100]. Albeit large progress has been made in the artifacts removal methodologies, new challenges of artifacts removal emerge as newly introduced recording techniques lead to new kinds of artifacts or artifacts mitigation is required in special situations. In recent years, concurrent EEG/fMRI recording [101] is becoming more and more prevalent because these two modalities can provide complementary information to have the benefit of high temporal resolution and spacial resolution. In this case, gradient artifacts caused by a magnetic field is introduced into EEG recording. The requirement of gradient artifacts removal emerges and corresponding methods are proposed to remove such artifacts from EEG signal [102,103,104]. Let us consider another situation that artifacts cannot be eliminated by routine methods. A new method (e.g., data completion method [105]) is required to tackle this problem. Therefore, the development of artifacts removal methods is not enough to tackle all cases. Efforts are continuing to be invested in the research of artifacts removal. We think that artifacts removal methods will be tailored to orient specific situations in the future, rather than for a general purpose. For example, a customized method will be developed to remove artifacts stemming from a particular movement and source (e.g., muscular contraction of the neck).
Currently, almost all experiments for cognitive state research are designed based on rational assumptions at a well-controlled environment (e.g., laboratory). Indeed, this is a feasible and effective way to probe into human cognitive states. However, can the assumptions be always true and accurate? A higher difficulty task might not always induce a heavier workload compared to a lower difficulty task. Possibly, the difference induced by two different difficulty levels of tasks is not distinct and is not enough to lead to differential characteristics in recorded signals (data). This assumption issue is more serious in the emotion studies. Images or videos with emotional contents are usually utilized to induce emotions of participants. It is assumed that emotion presented in an image or video is exactly induced in participants. This does not seem rigorous. The only thing guaranteed is that participants perceive different emotions presented in stimuli of images or videos. Whether the subsequent feeling of the same emotion as presented in the image or video is undetermined. An additional measure is necessary to ensure that the required emotion is induced. In addition, the scenario set up at a laboratory more or less differs from a scenario in daily life. Therefore, induced cognitive states at the laboratory are not the same as that appear in daily life. In the future, a more realistic scenario is required to investigate cognitive states so that mechanisms revealed in such a situation could be closer to ones they should be. For example, to explore the effect of walking on the human brain, overground walking is better than treadmill-based walking as overground walking is more naturalistic and the same to the walking in daily life [106,107]. Similarly, cognitive states should be induced in a realistic scenario. For instance, neurophysiological signals corresponding to emotions should be extracted from full continuous recording during constraint-free conversation according to a simultaneous video recording that used to detect when an emotion appear. Definitely, such a realistic scenario setting dramatically increases setup difficulty and requires more effort in the following data processing. It might also enhance difficulty to control confounding factors. However, all extra costs are worthwhile in order to really understand the mechanisms of cognitive states.
Among cognitive states discussed in this chapter, fatigue is relatively extensively investigated from the perspective of brain connectivity, ranging from laboratory-based study [35,41] to realistic study [48]. For the others, more studies are required to understand them further from a brain connectivity perspective. Using neurophysiological signals, human intentions can be decoded to establish a brain-computer interface for controlling external assistant devices [108,109,110] or interacting with outside world [111,112,113]. The analogous systems for monitoring cognitive states will be more prevalent than ever. In order to facilitate practical use, systems for monitoring cognitive states will be further miniaturized to be more portable and more comfortable to users. We have seen this trend in the EEG recording device. Dry electrodes have been adopted in the EEG recording system to reduce the preparation time before the use. The wireless technique has been applied for data transmission so that data cable is not necessary any more, which restrains the mobile range of EEG recording. Moreover, smart devices that have been used in daily life will be more deeply integrated into the monitoring systems of cognitive states. For example, we have developed a driving fatigue monitoring system, where a smartphone is integrated into the system to show fatigue level in real-time. In the future, appliances will be connected to the monitoring systems to better serve human by mutually sharing information between them. For example, the air conditioner automatically adjusts room temperature according to the monitoring data of human states. This can be seen in the near future because all the required techniques are ready. The new generation of communication technique (i.e., 5G) has been being used to largely enhance communication bandwidth, which makes it possible to have many things communicated with each other at the same time. By then, comprehensive information including cognitive states is collected from human and transferred to a clinician for cognitive assessment. As artificial intelligence is rapidly advanced, more and more work that has to be done by a clinician before will be taken over by artificial intelligence. With the benefit of super-speed communication technique, heavy computation demanded by artificial intelligence implementation can be shifted to a remote computational server. Such remote access to the computational resource is now available. Amazon web services (AWS) is one of the providers for the service. We believe that the use of the remote computational resource through the internet will gradually replace separate local computational workstations. Measured data are uploaded to a remote server for processing and analysing. The results are sent back to users for their review and record.
With more mechanisms relevant to cognitive states were revealed and the alterations of cognitive states were more deeply understood, a straightforward question appears in mind: is it possible to delay adverse changes in cognitive states and even to eliminate the adverse effect? A hint of possibility is given by the study of vigilance enhancement using visual challenge strategy [114]. Participants were requested to detect intruders in a simulated factory environment under two conditions with and without the presence of visual challenge (a rain obscuring the surveillance scene). They found that the visual challenge results in vigilance enhancement. Another study using a haptic stimulus showed that the haptic stimulus could help maintain vigilance [115]. As we know, rest can help recover from fatigue and make the brain refreshed. This viewpoint was supported in terms of brain connectivity according to a study stated that a short break (rest) gave rise to a positive effect on preventing the changes of connectivity pattern towards fatigue [28]. These studies are still at very preliminary stage to address the mitigation or prevention of adverse changes of cognitive states, but the feasibility of cognitive modulation at some cases has been shown. In the future, a variety of manners other than those reported in the above studies will be investigated. This cognitive modulation will be integrated with a cognitive monitoring system so that an unwanted cognitive state could be detected and changed in real-time.
Machine learning methods have been successfully applied to decode brain activity to recognize cognitive states (e.g., fatigue level). Up to now, only classical and simple classification classifiers have been utilized to distinguish different levels of cognitive states based on connectivity features. More sophisticated classification methods are required to improve classification performance. In the past decade, deep learning has attracted much attention and has been very successful in image captioning, segmentation and recognition [117,118,119,120,121]. It also exhibits promising performance in EEG classification [2,122,123,124,125]. In the future, deep learning will also be used to classify connectivity features to infer cognitive states. Before that, efforts should be paid to propose a suitable model structure and parameter setting. Another point we want to mention is that cognitive state classification only focuses on within-category classification. This is, the classification aims to differentiate different levels of the same cognitive state (e.g., fatigue levels), rather than to distinguish one cognitive state from another (e.g., fatigue versus workload). In Inter-Regional Connection Figure 1.6: (a) High-order functional connectivity (HOFC) is obtained by correlation between topographical profiles, which are derived from connectivity strength estimation using any method presented in Sect. 1.2. These connectivity strength estimations represent inter-regional connections, which constitute low-order functional connectivity (LOFC). (b) Associated high-order functional connectivity (aHOFC) is a measure assessing similarity between the topographical profile and the high-order topographical profile. (c) Illustration of connections and profiles of the LOFC, HOFC, and aHOFC. Reprinted from [116] with permission of IEEE.
the future, the cross-category classification will be performed. Ideally, a trained classifier can recognize different levels of diverse cognitive states. Furthermore, these all levels of cognitive states can be classified in real-time. It is worth noting that low-order functional connectivity is currently used for classifying cognitive states. As shown in the latest study, high-order functional connectivity provides additional information characterizing mental fatigue [5] (see Fig. 1.6 for the illustration. High-order connectivity metrics can be extended as dynamic high-order connectivity metrics by incorporating temporal information over time.). These features of the high-order functional connectivity can be fused into a feature pool for performance improvement in the classification of cognitive states.

Conclusion
In this chapter, we reviewed the researches of cognitive states based on brain connectivity. An overview was first given to depict what was included in this chapter and typical signal processing for the analysis and classification of cognitive states. We then described the approaches which have been utilized to estimate connectivity strength. Subsequently, we summarised the findings of the data analysis and performances of the classification for mental fatigue, mental workload, vigilance, and emotion. Finally, we discussed existing issues and limitations and gave considerations about the future direction in this research topic. Overall, mental fatigue was more extensively investigated than the other three cognitive states. Although significant progress was made in the research of cognitive states based on brain connectivity, further efforts are required to address the issues and limitations existing in the current research of cognitive states. According to the achieved studies, it is undoubted that brain connectivity is one of the promising perspectives to understand cognitive states.