EEG-based spatio-temporal relation signatures for the diagnosis of depression and schizophrenia

The diagnosis of psychiatric disorders is currently based on a clinical and psychiatric examination (intake). Ancillary tests are used minimally or only to exclude other disorders. Here, we demonstrate a novel mathematical approach based on the field of p-adic numbers and using electroencephalograms (EEGs) to identify and differentiate patients with schizophrenia and depression from healthy controls. This novel approach examines spatio-temporal relations of single EEG electrode signals and characterizes the topological structure of these relations in the individual patient. Our results indicate that the relational topological structures, characterized by either the personal universal dendrographic hologram (DH) signature (PUDHS) or personal block DH signature (PBDHS), form a unique range for each group of patients, with impressive correspondence to the clinical condition. This newly developed approach results in an individual patient signature calculated from the spatio-temporal relations of EEG electrodes signals and might help the clinician with a new objective tool for the diagnosis of a multitude of psychiatric disorders.

Mental disorders are typically diagnosed based on psychiatric interviews with the patients and their families and on the patients' documented medical reports, including neurological examinations [1][2][3] . Since the diagnosis is based to a large extent on subjective assessments and possibly thus delaying diagnosis, therapeutic interventions may be inappropriate or ineffective emphasizing the need for an objective biomarker to establish a firm diagnosis in an early stage of the disease and to help the development of precision and biological psychiatry 4,5 .
Electroencephalography (EEG) is a widely used, inexpensive and well-established technology for assessing brain electrophysiology; it is mainly used in the diagnosis of epilepsy 6,7 . EEG signature activity such as restingstate power, spectral and functional connectivity analyses as well as microstate analyses have been suggested as possibly relevant in diagnosing schizophrenia [8][9][10][11] and major depression [12][13][14][15][16] ; however, it is not used in clinical practice for such purposes as of yet.
We suggest using EEG for diagnosing mental disorders. Our approach follows recent developments in dendrographic hologram (DH) theory [17][18][19][20] , which is based on representing systems (physical, biological, cognitive) by events generated during discrete periods.
In physics, this approach corresponds to the event-picturing of the universe [21][22][23] . Events are outcomes or patterns of outcomes of measurements. Bohr repeatedly highlighted the role of the phenomenon-the event of the individual outcome of a measurement, for instance, a dot on the photo-emulsion screen in an interference experiment with photons or electrons 24 . DH theory is heavily based on the methodology of quantum theory; however, the quantum microsystems cannot be used directly. Thus, the outcomes of measurements are obtained in a process of complex interactions among systems and measurement devices, for example, interactions between photons and photodetectors 25 .
To obtain knowledge on a patient's mental state, the neurologist or psychiatrist uses various observation techniques like EEG or MRI, or asks questions, which in this case are considered measurements. In cognitive studies, outcomes of mental observations are not intrinsic properties of the human psyche, but rather events www.nature.com/scientificreports/ (phenomena, according to Bohr) associated with brain function 26 . It thus seems reasonable to use the event approach from physics for the study of system behaviour, cognition and the human psyche. We continue Bohr's work involving a modern interpretation of quantum mechanics for obtaining information. According to Bohr, the outcomes of measurements are not the objective properties of systems. They quantitatively represent interrelations between a system and an observer (measurement device of the observer, e.g., EEG device). The knowledge (or information) obtainable on a system by the observer (may it be quantum, classical or biological) is extracted from experiments (collection of data, information). Thus an EEG device will interrelate with a patient and obtain knowledge from him in the same manner as subjective assessments based on a structured interviews in psychiatry. We adhere also to Wheeler's work 27 with his "it from bit" program of reconstruction of physics and the methodology of information biology, which started with Johnson's 28 characterization of information theory as a general calculus for biology. According to Gatenby and Frieden, life without matter and energy is impossible 29 . Johnson claimed that life without information is also impossible 28 . DH theory presents a novel application of the aforementioned ideas by using hierarchic clustering algorithms to represent events as trees-dendrograms 17,18 . For concrete experimental data, trees are finite, but as shown by Shor et al., in theory, infinite trees exist as well [17][18][19][20] . For practical applications, the most useful trees are homogeneous ones, where the number of edges for each vertex is identical. A p-adic tree structure is characterized by one incoming edge and p outgoing edges for each vertex, where p is a natural number larger than one (p > 1). p-adic trees can be imbued with an algebraic structure, including addition, subtraction, multiplication and, for prime p's, even division. The simplest trees are 2-adic ones. We used clustering algorithms to generate such trees. The trees can be invested with ultrametric topology, whose distinguishing property is that any two balls are either disjointed or one is a sub-ball of the other.
Furthermore, p-adic trees imbued with algebra are known as rings of p-adic numbers 30 . They have been widely used in areas of physics such as string theory, cosmology, general relativity and quantum theory [31][32][33][34][35][36][37] . Parisi used p-adic numbers in the mathematical formulation of the replica symmetry method that serves as the basis of the theory of complex disordered systems [38][39][40][41] . p-adic trees were also used in biology [42][43][44][45][46][47][48] , for instance, to model information-processing in the brain and conceptualizing human memory retrieval 42 . Moreover, Freud's idea on the splitting of cognitive processes into two closely connected domains (consciousness and subconsciousness) is modelled based on the p-adic field and shows the process of thinking as a random dynamical process 46 .
The transition from theoretical modelling to practical applications is presented in an article by Shor et al. 49 . Here, the clustering algorithms and generated dendrograms thereof were used to represent hierarchic relations between events that consist of EEG measurements. The novel technique is based on a time series of dendrograms instead of straightforward use of an EEG-output time series. The medical diagnostic algorithm was based on a relatively rough dendrogram analysis known as quantum potential, which is a central concept of Bohmian mechanics. We interpreted the data according to Bohm and Hiley 26 . It should be noted that quantum probability and information are widely used in the modelling of cognition, decision-making, psychology and social sciences 42,[50][51][52][53] and are known as quantum-like to distinguish them from genuine quantum theory of cognition 54,55 . Bohr emphasized the possibility to apply quantum methodology in biology 56 and Shor et al. described the quantum-like model as a dendrogramic configuration space 20 .
We define the fundamental concept of DH theory as the "event". An event can be any single measurable feature of a sample space or a number of such features. Each event is related to every other measurable event in the specific sample space. For example, the calcium level in a specific blood test is related to the calcium level in a previous blood test.
Using objective tools to classify psychiatric patients is a great challenge. We here present a novel algorithm using EEG to differentiate patients suffering from psychiatric disorders (depression and schizophrenia) and control participants. By means of a distance metric and a linkage algorithm as described in detail in the methods section, relations between events can be represented as tree structures called dendrograms.
We show that patients' personal DH signatures based on EEG recordings accurately differentiate patients with diverse psychiatric disorders. This personal DH signature provides an accurate picture of hierarchic interrelations between events generated by patients' brains, leading to more precise diagnosis of psychiatric disorders.

Methods
The study adhered to the rules and regulations of the Helsinki Declaration and was approved by the Institutional Review Board (IRB) of the Rabin Medical Centre, Petach Tikva, Israel (0275-20-RMC). The study was approved as retrospective clinical, and the need for informed consent was waived by the ethics committee. All patient data were fully anonymized before review.
Participant groups. Electronic medical health records (EMHR) were used to identify all participants that underwent at least one EEG examination between the years 2011 and 2019. The participants were then divided into the following groups: control participants undergoing EEG due to indications unrelated to neuropsychiatric diseases, participants with a diagnosis of major depressive disorder (MDD) and patients diagnosed with schizophrenia. A total of 166 participants (average age: 52 EEG data acquisition. The EEG recordings were retrieved from the EMHR of all patients. EEGs had been recorded in a routine clinical setting by an experienced EEG technician. All the patients included in the study had undergone EEGs between 8 am and 1 pm using a Nihon Kohden surface EEG (19-electrode standard according to the international 10-20 electrode placement system) with a sampling frequency of 500 Hz (Nihon Kohden, Japan). During the EEGs, patients had been awake in a resting position with open or closed eyes.
To extract the hierarchical relational dendrogram from the patients' EEG signals, we converted the raw EEG data from the 19 active electrodes (elec) into the European Data Format (EDF). Data then was filtered to remove the 50-Hz mains signal and further filtered with a high-pass filter of 1 Hz. Data was used without removing muscle artefacts or clarifying open or closed eyes state. To assess the possibility that artefacts in the EEG recordings might account for group differences, we used artefact removal algorithm as described below. For removal of independent components (ICs) of artefacts related to ocular, muscular, cardiac activities, or other movement artifacts, we used EEGLAB toolbox 57 and its FASTER plugin 58 . In short, the pre-processing procedure involved filtering all recordings by a high-pass filter of 1 Hz as well as a notch filter of 50 Hz. This was followed by noisy channels and independent components (ICs) of artifacts related to ocular movements, muscle artifacts, cardiac activities or other movement artefacts, identification by the Faster algorithm. The identified noisy channels were interpolated and artefactual ICs were removed, respectively.Analysis was done using MATLAB software (Mathworks, Natick, MA).

Receiver operating characteristic (ROC).
ROC analysis is used clinically to quantify how accurately medical diagnostic tests (or systems) can discriminate between two states. The ROC curve shows the trade off between the true positive fraction (TPF) and false positive fraction (FPF) as one change the criterion for positivity. The area under the curve (AUC) summarizes the entire location of the ROC curve Thus the AUC is a measure of sensitivity, specificity and validity of diagnostic tests. Roc analysis was accomplished with MATLAB software (Mathworks, Natick, MA).

Universal dendrogram analysis and calculation of patients' personal universal DH signatures (PUDHSs).
For each electrode in a person's EEG (19 in total), we chose a 1 s window consisting of 500 data points (EEG sampling rate of 500 Hz). Each person's universal dendrogram was constructed by calculating the pairwise Euclidean norm distances between all 1-s windows across all 19 electrodes (see an illustration in Fig. 1). Then a Ward linkage algorithm was employed, resulting in a single personal universal dendrogram (D universal ). For each branch of each D universal we calculated the sum of its p-adic expansion: Thus, V i is a natural number that represents the relation between event i and all event j s where j = i. Consider a dendrogram represented by a (finite) 2-adic tree: the root of the vertex indicates the origin of the 2-adic coordinate system, and each node has one edge going into it and two edges coming out of it. Branches are pathways of combined edges that go from the root edge to an edge at the bottom level of the tree. Each branch is labeled by a binary string of 0 s and 1 s, composing a natural number that encodes the branch (or a point at its bottom level). The set of all branches in the tree is a two-dimensional structure called the dendrogram topology. One concrete system of branch-labeling known as the prefix-code, widely used in information theory, is also used here. The 2-adic metric is the distance between natural numbers, which is determined by the hierarchic structure of the tree. The distance between two branches is determined by their common root-branch: the longer the common root-branch, the shorter the distance. This 2-adic representation uniquely determines a specific branch, say branch i or event i, as well as the branch's/event's relations to all other branches/events. We label this 2-adic number for branch i/event i as Vi.
It should be kept in mind that we currently analyze the relations between EEG-outputs (events) rather than the absolute magnitude of the outputs The relations are expressed by 2-adic numbers, each representing a complex context of spatial (locations of 19 electrodes) and temporal dynamics of the state of the brain.
Each patient's EEG recording is represented as a hierarchic relational dendogram. A time window of 1 s was chosen for all analyses. According to the frequency of a sample of each patient's EEG recording, for each of the patient's 19 electrodes, we prepared 500 vectors of size 1 s × (frequency of sampling), resulting in 500 s of recording divided into 19 × 500 vectors. Thus, a matrix of 9500 row vectors was obtained, with each vector representing an "event" whose relations to all other vectors were yet unknown. To reveal these relations, first pairwise Euclidean distance between all events (9500 × 9499/2 such distances) was calculated. Then the events www.nature.com/scientificreports/ As noted above, each branch can be represented by a 2-adic expansion that encodes its relations to all other branches (events) and the sum of an event's 2-adic expansions is a natural number. Thus, 9500 such natural numbers, fully representing the dendrogram topology, were obtained for each patient, defining the personal universal dendrogram.
To evaluate the topological structure of each patient's personal dendrogram, a threshold number must be defined. The threshold number dissects the universal dendrogram into subsystems as follows (further discussed in the results section): Here, z is a natural number (a pre-chosen free parameter of the model) set to the same value for all patients, where personal universal dendrogram is a single dendrogram constructed by all events recorded from a patient. Moreover, 2-adic ball of dendrogram branch Vi is defined by log 2 ⌊ Vi of dendrogram branch ⌋ where In this approach, T personal universal dendrogram is determined individually for each patient's dendrogram and varies from patient to patient. Once the threshold was defined, we recorded for each patient the number of branches that were smaller than the threshold.
The patient's personal universal DH signature (PUDHS) is given by the quantity: To calculate PUDHS , we chose a natural number between 1 and 8 as the value of each patient's parameter z.

Block dendrogram analysis and calculation of patient's personal block DH signatures (PBDHSs).
As the resources (both computational and time) for constructing a large universal dendrogram become the limiting factor for dendrograms with more than 100 000 branches, we created a block dendrogram DH signature that is much more efficient: we decomposed the previously described dendrogram into a time series of blocks of dendrograms. Following, the corresponding number of edges created by 19 electrodes (9500) was reduced significantly according to the block size: for each of the 19 electrodes, we chose a window of 1 s which consisted of 500 data points. Furthermore, we chose how many windows (which are measured in seconds) would be included in the dendrogram (1, 3, 5 or 10). We then created a dendrogram with the corresponding number of edges to these 19, 57, 95 or 190 (see an illustration for 1 and 3 windows in Fig. 1). Each such dendrogram is constructed by pairwise Euclidean norm distances between all the 1-s windows of the 19 electrodes. Then, Ward's linkage algorithm is employed with a single resulting dendrogram with 19, 57, 95 or 190 branches. Using this procedure, we analyzed for each patient 500 s in the block dendrograms of each of the various sizes.
The total amounts to a time series of 500, 167, 100 or 50 dendrograms. For a particular size of dendrogram blocks, we obtained the patient's personal block DH signature, which is defined as: D i , where i = 1, 2..n and n = number of block dendrograms in the dendrogramic time series (in our calculations, n = 500, 167, 100, 50).
Each dendrogram consists of: For each branch, we calculate the sum of its p-adic expansion: Thus, V i is a natural number that uniquely represents the relation of event i to all other event j s. Following, n vectors of natural numbers V i each of size m that represent the topology of each dendrogram D i . For each of the vectors, we set 2 thresholds: T dendrogram (intra-system threshold) and T1 dendrogram (intersystem threshold), defined as follows.
where the free model parameter z1 was a specific natural number that was identical for all patients. z1 set the 2-adic ball level lower than that of the dendrogram ball.
The threshold T dendrogram was determined individually for each patient and for each patient's dendrograms (relational block subsystem).
The 2-adic ball value of each dendrogram was calculated as: ⌊(log 2 (max Vi of dendrogram))⌋ where the model parameter z2 was a natural number that was identical for all patients. z2 set the 2-adic ball level lower than that of the maximal ball of all block dendrograms. The threshold T1 dendrogram was determined for each individual patient and varied among patients according to the parameters of each patient's relational block subsystem.
The maximal p-adic ball value of all dendrograms was calculated as www.nature.com/scientificreports/ and the T1 dendrogram was set accordingly for all dendrograms. Each dendrogram in the dendrogramic time series was marked by two numbers, E and E1, with values in the range 1-19 × number of windows. E indicated how many branches were smaller than the inter-system threshold-T dendrogram , while E1 indicated how many branches were smaller than the intra-system threshold-T1 dendrogram .
For each value n in the range 1-19 × number of windows, we constructed a histogram F with bins centred at 1,2…n. Each bin included a number that indicated the number of systems dendrograms in the time series whose E value was identical to the value of that bin's centre-point. A similar histogram, F1, was constructed for the E1 values. For histogram F, we chose randomly a fixed number, h, of bin centres. The chosen bin centres values were kept in the vector p with length h. For histogram F1, we again randomly chose the same fixed number, h, of bin centres. The chosen bin centres values were kept in the vector p1 with length h.
The patient's personal block DH signature (PBDHS) was then calculated as follows: This formulation makes it possible to combine the PBDHS and the two thresholds (inter-and intra-system), each of which reveals various features in different p-adic order levels of the block dendrograms, into one signature score.
To maximize the discrimination levels between groups, we calculated the PBDHS with various z1 and z2 combinations. For each combination, we randomly chose different p and p1 bins out of the full histograms F and F1 and repeated these 1 million times. We thus obtained 64 × 3 million (3 different pairs of groups), and ROC AUC values for the differences between pairs of patient groups were calculated using PBDHS values. The sum of AUC values of the 3 groups was calculated for each run.

Ethical publication statement.
We confirm that we have read the Journal's position on issues involved in ethical publication and affirm that this report is consistent with those guidelines.

Results
Characterization and differentiating of participant groups according to PUDHS. The topological structure of a patient's dendrogram quantified as PUDHS shows high differentiation values for each patient group (all data following artefact removal; control: n = 96, 9516.6 ± 1.99; schizophrenia: n = 42; 9360.7 ± 1.62; p < 0.001; depression: n = 28; 6922.3 ± 2022.5; p < 0.001), Fig. 2D). The accuracy of the EEG-based PUDHSs in differentiating control subjects from patients with schizophrenia and depression is disclosed using receiver operating characteristic (ROC) curves. Control patients were differentiated highly accurately from patients with depression (AUC = 0.9986, p < 0.0001, Fig. 2A) and schizophrenia (AUC = 0.9908, p < 0.0001, Fig. 2B). Likewise, patients with schizophrenia showed high differentiation from those with depression (AUC = 0.9973, p < 0.0001, Fig. 2C). Artefacts in the EEG caused by eye blinks, muscle activation, or other movement artefacts were removed for each patient's EEG as described in the methods.
To further ascertain that the patient groups themselves are distinct and to validate that the data does not contain other unwanted combinations of patients, we used 10 000 random groupings of all patients into three groups sized as our patient groups (96, 42 Fig. S1-C).
The impressive segregation between the three groups (patients with schizophrenia, depression, or control participants) is independent of the chosen EEG segment. We validated this by moving the 500 s period analyzed by 200 s. We thus verified that the differences in topology of the dendrograms, which represent relations between events, are stable even after changing the EEG segment of our analysis (Fig S2; EEG  Our results indicate that EEG events show a specific relationship commonly found in controls participants but much less so in patients with schizophrenia and still less in patients with depression. Relationship-block subsystems. Clinical use of our method might be limited due to constraints of computational resources necessary for calculating dendrograms of the size described here. To tackle this, we dissected ⌊(log 2 (max Vi from all dendrograms in the patient time series))⌋ www.nature.com/scientificreports/ the EEG data as used above (500 s segments) into fragments of equal size (1 s, 3 s, 5 s, 10 s). For each sub-segment, we created a dendrogram accordingly. It is thus possible to construct a time series of smaller dendrograms, which significantly reduces the necessary computation power. The topological structures of each patient's time series of dendrograms are characterized by PBDHS when using two thresholds, T dendrogram and T1 dendrogram , as described in the methods. Assuming that each group of patients is characterized by a different sub-system topological structure of dendrograms, the PBDHS will reflect these different topological structures as unique for each patient group. Choosing a dendrogram time series with different edges (19,57,95 or 190), we show a preserved discrimination power of those dendrograms for separating the patient groups (Fig. 3). Focusing on the dendrogram time series reflecting only spatial (and not temporal) features (19 simultaneous recordings from 19 electrodes and a second vector for EEG data), we obtained a high discrimination between patient groups (Table 1; Fig. 3A). By adding temporal features to the spatial separation of EEG data (57, 95 and 190 edges), separation between PBDHS values increased accordingly, which is reflected in the AUC values as well as in the PBDHS cumulative distribution function (CDF; Table 1, Fig. 3B-D). EEG artefact removal as described above as well as in the methods part did not change the segregation capability of the PBDHS (Fig. S4 and Table 1).  www.nature.com/scientificreports/ main dendrogram ( Fig. 4; thin light blue squares). These subsystems or sub-dendrograms merge at values that are lower than the threshold and closer to the root of the main dendrogram. Quantifying events that are lower than the threshold provides the number of disconnected subsystems with the same 2-adic ball radius. Thus, the PUDHS values indicate that in the control group, significantly more disconnected subsystems exist than e.g. in the schizophrenia group. Both control participants and patients with schizophrenia have more disconnected subsystems in their dendrograms than the group with depression. The distinct dendrogramic topology of each group of patients implies a simple physiological consequence: in the control group each EEG event is p-adically more distinct from each other, indicating that each event has its spatial location and temporal order, and serves as an autonomous information system that connects in a distinct manner to other spatio-temporal events. The information of events in the schizophrenia patients is comparably less segregated and more dispersed and even more so in the patients diagnosed with depression.
EEG mean band power. Traditionally, EEG recordings are compared using regular band power methods.
To compare our results with these classic analysis, we calculated for each band (alpha, beta, gamma, delta) the mean power of each electrode of each patient in the same 500 s data. We then calculated by ROC analysis the AUC values for each pair of patient groups at the same electrode (Fig. S5). AUC values of 0.7395 for comparing the 8 th electrode mean power values between control and depression patients were found. This value indicates a lower separation efficacy by regular power spectrum methods. Moreover, the mean powers

Discussion
The novel DH theory utilizes dendrogram representation of data as p-adic numbers to demonstrate the integration of the holistic brain function embodied in EEG signals with inert hierarchy of the brain signals. Namely, by extracting characteristic information patterns from dendrograms expressing the hierarchical treelike structure of information processing in the brain, encoded by p-adic numbers, we successfully differentiate and categorize the neuropsychiatric disorders depression and schizophrenia. Furthermore, AUCs showed high values, indicating high accuracy of differentiating patients with schizophrenia and depression from controls. This approach shows that the individual signatures described in the Results and Methods sections are useful for identifying those neuropsychiatric disorders. Thus, it seems that during information processing, healthy brain functioning is characterized by significantly higher degrees of hierarchical interconnection, with high segregation of information across space and time compared to patients with schizophrenia or depression. The last statement, however, should be viewed with great caution, since EEG signals provide only a rough estimation of brain functioning.
The search for biomarkers that assist in diagnosing brain disorders has so far focused primarily on either biological samples, including serum or cerebrospinal fluid (CSF), or neuroimaging techniques, including magnetic resonance imaging (MRI) or functional MRI (fMRI). These methods are either invasive or expensive, and none has yielded an accurate biomarker for diagnosis of heterogeneous disorders such as major depression or schizophrenia [59][60][61][62] . Several EEG data analysis techniques have been used in recent studies in attempts to diagnose psychiatric disorders like schizophrenia [8][9][10][11] and depression [12][13][14][15][16] . A machine-learning algorithm approach with promising results has been developed by Wu et al., who used resting-state EEGs to predict treatment responses in major depression 63 . Most studies use EEGs within a special research environment involving standardized situations, separate open and closed eye conditions, and artefact reduction. The clinical applicability of these methods for screening, diagnosis, and prediction of response to treatment is rather difficult and so we opted to use real-world EEG data. This enhances the generalizability but increases the risk that features of the clinical EEG recording environment might impact results. Recently, progress was made to accurately classify healthy subjects and patients with depression and schizophrenia by automated geometrical feature extraction of EEG signals [64][65][66][67][68][69][70][71][72][73][74] . The accuracy of these methods to separate these groups is non-inferior to our presented method, although their algorithm uses multiple feature extractions and thus the physiological interpretation is difficult. Contrary to this, we postulate an inherent distinction between information produced in the brain, both in a spatial and temporal fashion, in a disease dependent manner. We found a concrete and mathematically coherent method relying only on one feature namely the spatio-temporal connections of information signals of the brain.
It should be noted that the current authors initiated their study of hierarchical/p-adic representation of brain signals in a previous study that was recently published 49 . That study showed promising evidence of the power of hierarchical and topological features of dendrograms, quantified by the p-adic quantum potential, in discriminating among multiple neuropsychiatric disorders including depression, schizophrenia and cognitive decline. The method used previously relied on machine learning and quantified different topological features of dendrograms. A patient's dendrogramic signature as described here provides a more refined characterization of mental state than of quantum potential. The relatively rough characterization of the relational hierarchy in information representation of the brain is a powerful enough mechanism for the quantification of cognition and diagnosis of mental disorders. Moreover, the new dendrogramic signature provides a unique range of values for each psychiatric disorder and mental state.
Further investigation is needed to study the combination of features quantified in the present study and expressed as patients' dendrogramic signatures, alongside the quantum potential measure. Such comparative medical diagnostic studies may impact basic studies of cognition using PUDHS as a quantitative measure of cognitive processes. Moreover, further optimization of the threshold parameters is needed, especially considering the obvious expectation of applying this method to the diagnosis of other psychiatric, neurological and neurodegenerative disorders and to monitoring the response to treatment and progression of these disorders.