Abstract

Abstract

Supervised machine learning methods continuously prove to be highly valuable for brain activity interpretation. The similarities and differences between psychedelic and oneiric states of consciousness are numerous, and neurophenomenological overlaps have been suggested. Therefore, the present research aims to uncover to what extent a supervised machine learning classifier, trained on electroencephalogram (EEG) data from an N, N-dimethyltryptamine (DMT)-induced state of consciousness, can generalize to Rapid Eye Movement (REM) dream states. The findings indicate that two classifiers, trained on the alpha and gamma frequency bands from the psychedelic state, can effectively discriminate between the REM dream state and the wakeful one, thereby providing further evidence of the similarities between DMT and dreaming states. Keywords: Machine learning; EEG; Supervised learning; REM; Gradient Boosting; DMT.

Introduction

Dreaming and psychedelic-induced states of consciousness share numerous similarities and differences, leading researchers to hypothesize common neurophysiological aspects (Kraehenmann, 2017; Jacobs, 1978; Froese et al., 2018). Moreover, numerous studies have highlighted the need to analyze these similarities to fully reveal the link between them, as it could lead to the development of previously uncovered

methods

of psychiatric therapy (Kraehenmann, 2017). Ongoing research about the underlying mechanisms of dream states during Rapid Eye Movement (REM) and Non-Rapid Eye Movement (NREM) sleep has yielded a considerable amount of evidence suggesting that mentation can occur in all stages of sleep; however, results show that vivid dreaming mainly occurs during the REM period (Nielsen, 2000). Because of this, the present paper will focus solely on this stage. The psychedelic compound considered in this research is N, N-Dimethyltryptamine (DMT). Recent studies have highlighted the possibility of endogenous release of DMT within the human brain (Barker, 2018), possibly modulating the dreaming states themselves (Pitkanen, 2019). Furthermore, the exogenous administration of DMT has been shown to initiate spontaneous eye movements, a trait shared with the REM sleep stage (Strassman, 2000). Notwithstanding, no causal link has been fully identified. The close resemblance of the phenomenological and neurophysiological features of psychedelic-induced states and REM sleep is further supported by similar neurobiological mechanisms of mental imagery, similar retrieval and activation of emotional memories, a decrease in logical reasoning (directly proportional to an increase in associative reasoning), and similar changes in sense of self (Kraehenmann, 2017). Furthermore, cognitive bizarreness has also been found to increase in both states (Froese et al., 2018). Despite uncovering significant similarities between the psychedelic and dreaming states of consciousness, much of the underlying mechanisms remain to be discovered (Kraehenmann, 2017). Previous studies with similar research questions have successfully employed machine learning techniques for EEG data classification purposes. Therefore, the supervised machine learning models employed in this research consist of Logistic Regression, Support Vector Machine (SVM), Random Forest, and Gradient Boosting. SVM has been demonstrated to be successful in EEG data classification (Shaabani et al., 2020), and, in related research, the SVM and Random Forest models have shown to be more accurate than their unsupervised counterparts (Hosseini et al., 2021). Similarly, Random Forest and Logistic Regression have yielded highly accurate results when employed with EEG data for classification purposes (Klok et al., 2018; Guerrero et al., 2021). Lastly, Gradient Boosting was included due to its utilization in multiple successful EEG classification paradigms, such as in the research carried out by Albaqami et al. (2021). In light of all the evidence, the goal of this study is to uncover to what degree a supervised machine learning classifier, trained on data from a DMT-induced state of consciousness, generalizes to the REM sleep state.

Methods

To answer the research question, the aforementioned machine learning classifiers were trained on EEG data from subjects under the influence of DMT, along with their corresponding baseline, to uncover any patterns that allow the classifier to predict whether a patient is under the effect of DMT. With the same model, the goal was to observe whether the identified DMT patterns could be used to discriminate between the REM dreaming stage and the awake states: positive results from the generalization of a DMT-trained model on REM data might suggest similarities between them. The datasets used throughout this paper were extracted from Pallavicini et al.’s work (more specifically, from

“Neural and subjective effects of inhaled N, N-dimethyltryptamine in natural settings”) and from Liu et al.’s research (“DEED: A Dataset for Dream-related Emotion Research“): these include DMT and EEG sleep data respectively. The DMT dataset contains the EEG data of 29 participants, recorded with a 24-channel mobile system attached to an elastic electrode cap stem. Before DMT administration, baseline EEG was recorded for each participant with eyes open and closed; the data is divided into 2-sec epochs, bandpass-filtered (1-90 Hz) and notch-filtered (47.5 – 52.5 Hz) (Pallavicini et al., 2021). Similarly, the DEED dataset (previously preprocessed by the researchers who collected the data) consists of EEG data with six channels for 92 nights, which amounts to 493 dreams recorded with a specific REM awakening paradigm. Before sleeping, baseline EEG was recorded, for both eyes open and closed conditions. Only the closed-eyes baseline condition was used for this research, as both the sleeping and DMT-induced conditions occur with eyes closed. Furthermore, given the nature of EEG and its high susceptibility to fluctuations, employing an open eyes baseline could have resulted in significant artifacts (such as eye blinks or non-research-inherent visual stimuli) (Kaya, 2021). Data preprocessing From both datasets, the following frequency bands were extracted: delta (<4Hz), theta (4-8Hz), alpha (8-12Hz), beta (12-30Hz), and low gamma (30-45Hz). Then, the data was divided into 2-second epochs. The power spectral density was calculated for each of these, reducing the electrode values into a singleton and addressing the significant disparity. Additionally, min-max normalization with the target range of [0, 1] was applied to ensure coherence and comparability across the various EEG channels. The preprocessing of the data led to the creation of two new variations of the previous datasets, which will henceforth be referred to as DMT and REM datasets. Feature selection To find the most relevant features, it was necessary to: (1) inspect which ones differed in activity across the DMT and baseline conditions, and (2) determine whether those differing features showed similar, non-overlapping properties across the REM and awake conditions. This process improved the ability of the model to discriminate between the states in question. To do so, with the help of a pair plot, the frequency of the data points for each band was plotted, displaying two histograms, of each condition, in one plot. As indicated in the upper Figure 1 (DMT/baseline), the delta, alpha, and gamma bands show the starkest difference in activity. Lower Figure 1 (REM/awake) shows that most frequency bands display differences between REM and awake states, with alpha being the clearest. Afterward, the classifiers were trained on the best prospective features: delta, alpha, and gamma. Unfortunately, delta proved not to add any value to the model. Thus, with delta discarded, alpha and gamma were chosen as the most appropriate features for the research. Splitting and Cross-Validation It was imperative to keep subjects exclusive to their corresponding training or test set; not doing so could have led to bias in the model's behavior. Therefore, due to the slight data imbalance in the DMT dataset and necessary group assortment, a stratified group split was employed: this allowed for maintaining the same ratio of classes in both the training and test set while preserving the subject's exclusivity. Ten-fold cross-validation was then used to train and validate the model: this method divides the dataset into ten subsets of equal size, using nine for training and one for validating. The process is reiterated ten times, thus using all data points for training, which poses an advantage over a random subsampling approach (Samui et al., 2017). Classifiers As previously mentioned, the supervised machine learning models employed were Logistic Regression, Support Vector Machine (SVM), Random Forest, and Gradient Boosting, which have all been successfully employed in previous similar research for EEG data classification purposes. Metrics As both datasets exhibited minor imbalances in the data, and class distributions, the F1 score was selected as the chief evaluation metric (Hicks et al., 2022). Additionally, due to their successful history with similar research designs, Area Under the Curve (AUC) and Receiver Operating Characteristics (ROC) were implemented as complementary measures (Nour et al., 2016). Lastly, to provide a more complete analysis of the results, recall, and precision were also included.

Results

The objective of the experiment was to train a machine learning classifier on EEG data obtained from subjects under the influence of DMT and to apply this model to classify between REM-stage dreaming and waking-stage EEG data. The classifiers were trained and validated with ten-fold cross-validation. All of the metrics used can be found in Table I. As can be seen, Random Forest achieved an F1 score of 0.54, the SVM obtained an F1 score of 0.75, and the Logistic Regression and Gradient Boosting both achieved an F1 score of 0.76. When considering the last three models, all have similar scores for both precision (with a high value of around 1) and recall (with a value of around 0.6). In terms of AUC scores, most models performed poorly. The SVM obtained a value of 0.55, while Logistic Regression and Gradient Boosting

obtained a value of 0.59. In Figure 2, the values of the highest REM score (“Test” bars) can be observed, as well as the average performance (“Val” bars) of the models throughout all cross-validation folds. Logistic Regression exhibited the highest variability; in contrast, Gradient Boosting achieved a lower validation score over all cross-validation splits. Lastly, Figure 1 displays the ROC curve of the Gradient Boosting classifier, which resulted in a mean AUC score of 0.72. Overall, as the F1 score was used as the chief metric, the models' performance was satisfactory. Gradient Boosting performed the best, achieving the highest F1, precision, and AUC scores. These results could imply the importance of the alpha and gamma bands as predictors for DMT and REM state generalization.

Discussion

This research study aimed to uncover to what degree a supervised machine learning classifier trained on data from a DMT-induced state of consciousness generalizes to dream states during REM sleep. The results showed that a supervised machine learning classifier, specifically Gradient Boosting, can effectively classify REM sleep states when trained on EEG data from DMT-induced conditions. Moreover, the findings further highlighted the link between neurophysiological elements of dreaming and psychedelic-induced states of consciousness, as research previously suggested (Kraehenmann, 2017; Jacobs, 1978; Froese et al., 2018). More specifically, the

Figure 2

. Barplot showing the different models employed: the

two columns per model respectively indicate highest test score and mean validation score (with corresponding standard deviation). alpha and gamma frequencies showed the most substantial overlap, which suggests similar neural processes underlying the two conditions. This is supported by previous research: findings indicated a comparable occurrence of gamma activity in DMT conditions (Tagliazucchi et al., 2021) and sleep stages (Steriade & McCarley, 2013), as well as similar modulation of alpha oscillations (Moini & Piran, 2020). Numerous studies have highlighted the need for further research to fully reveal the link between the two states of consciousness. Psychedelics have been proposed as having the potential to treat addiction and various forms of mental

illness (Koslowski et al., 2021); consequently, further uncovering the shared neural correlates between the DMT-induced state and the REM could contribute to understanding their underlying mechanisms, which has the potential to result in the development of novel methods of psychiatric therapy (Kraehenmann, 2017). Despite the satisfactory scores achieved by the Logistic Regression, Gradient Boosting, and SVM models, it is crucial to address the study's limitations. The most prominent one pertains to the difference in EEG channels used for data acquisition in the two datasets: as previously stated, the DMT data was acquired through a 24-channel system, which offers a more detailed overview of brain activity. In sharp contrast, the DEED dataset was limited to only six channels. Such differences did not allow for spatial analysis due to a lack of overlap in electrode placement. Another impediment concerns the lack of comparisons performed: to reduce the chances of possible observer bias, an ideal scenario would involve the addition of a comparison between DMT and NREM states. Finally, it is important to note that the generalization observed in this research only goes one way. Training models using REM data to classify DMT and baseline states would strengthen the already provided evidence. Such limitations have led to suboptimal results within particular models and imperfect analysis; nevertheless, considering the findings which indicate a link between the neural correlates of the two states, along with the aforementioned limitations, promising potential for future research is suggested.

Conclusion

The neural substrates underlying the different phases of dreaming during sleep and the altered states induced by psychedelic substances have been suggested to exhibit numerous similarities. To further analyze and uncover the shared neural correlates, the present study investigated two Figure 3. ROC visualization resulted from ten-fold cross-validation for the Gradient Boosting classifier trained on DMT data. states of consciousness: N, N-Dimethyltryptamine (DMT) states and Rapid Eye Movement (REM) sleep. To pursue this goal, multiple supervised machine learning models were employed, with Gradient Boosting exhibiting the most optimal performance among the models tested. The results obtained in this study aligned with previous research, thereby reinforcing the notion of a potential association between these two states. These findings call for further investigation to enhance our understanding of the similarities and differences between these states, which, in turn, could yield valuable insights for both scientific research and medical applications.

References

  • Albaqami, H., Hassan, G. M., Subasi, A., & Datta, A.
  • (2021). Automatic detection of abnormal EEG signals
  • using wavelet feature extraction and gradient boosting
  • decision tree. Biomedical Signal Processing and Control,
  • 70, 102957. https://doi.org/10.1016/j.bspc.2021.102957
  • Barker, S. A. (2018). N, N-Dimethyltryptamine (DMT), an
  • Endogenous Hallucinogen: Past, Present, and Future
  • Research to Determine Its Role and Function. Frontiers in
  • Neuroscience, 12.
  • https://doi.org/10.3389/fnins.2018.00536
  • EEG Based Participant Independent Emotion Classification
  • using
  • Gradient
  • Boosting
  • Machines.
  • (2018).
  • IEEE
  • Conference
  • Publication
  • |
  • IEEE
  • Xplore.
  • https://ieeexplore.ieee.org/document/8692106
  • Froese, T., Leenen, I., & Páleníček, T. (2018c). A role for
  • enhanced functions of sleep in psychedelic therapy?
  • Adaptive
  • Behavior,
  • 26(3),
  • 129–135.
  • https://doi.org/10.1177/1059712318762735
  • Guerrero, M. E., Parada, J. S., & Espitia, H. E. (2021). EEG
  • signal analysis using classification techniques: Logistic
  • regression, artificial neural networks, support vector
  • machines, and convolutional neural networks. Heliyon,
  • 7(6),
  • e07258.
  • https://doi.org/10.1016/j.heliyon.2021.e07258
  • Hicks, S. A., Strümke, I., Thambawita, V., Hammou, M.,
  • Riegler, M., Halvorsen, P., & Parasa, S. (2022). On
  • evaluation metrics for medical applications of artificial
  • intelligence.
  • Scientific
  • Reports,
  • 12(1).
  • https://doi.org/10.1038/s41598-022-09954-8
  • Jacobs, B. L. (1978). Dreams and hallucinations: A common
  • neurochemical
  • mechanism
  • mediating
  • their
  • phenomenological
  • similarities.
  • Neuroscience
  • &
  • Biobehavioral
  • Reviews,
  • 2(1).
  • https://doi.org/10.1016/0149-7634(78)90007-6
  • Kaya, İ. (2021). A Brief Summary of EEG Artifact
  • Handling.
  • In
  • IntechOpen
  • eBooks.
  • https://doi.org/10.5772/intechopen.99127
  • Klok, A. B., Edin, J., Cesari, M., Olesen, A. N., Jennum, P.,
  • & Sørensen, H. B. D. (2018). A New Fully Automated
  • Random-Forest
  • Algorithm
  • for
  • Sleep
  • Staging.
  • International Conference of the IEEE Engineering in
  • Medicine
  • and
  • Biology
  • Society.
  • https://doi.org/10.1109/embc.2018.8513413
  • Koehrsen, W. (2018). Visualizing Data with Pairs Plots in
  • Python
  • Towards
  • Data
  • Science.
  • Medium.
  • https://towardsdatascience.com/visualizing-data-with-pair
  • plots-in-python-f228cf529166
  • Koslowski, M., Johnson, M. P., Gründer, G., & Betzler, F.
  • (2021). Novel Treatment Approaches for Substance Use
  • Disorders: Therapeutic Use of Psychedelics and the Role
  • of
  • Psychotherapy.
  • Current
  • Addiction Reports, 9(1),
  • 48–58. https://doi.org/10.1007/s40429-021-00401-8
  • Kraehenmann,
  • R.
  • (2017).
  • Dreams
  • and
  • Psychedelics:
  • Neurophenomenological
  • Comparison and Therapeutic
  • Implications.
  • Current
  • Neuropharmacology,
  • 15(7).
  • https://doi.org/10.2174/1573413713666170619092629
  • Liu, W., Zhang, Y., Ma, P., Zheng, L. S., Zhou, D., Chen, Z.,
  • Shen, M., Cai, Y., Lu, Z., Liu, Q., Luo, J., & Wang, X.
  • (2022). DEED: A Dataset for Dream-related Emotion
  • Research. bioRxiv (Cold Spring Harbor Laboratory).
  • https://doi.org/10.1101/2022.09.19.508475
  • Moini, J., & Piran, P. (2020). Functional and Clinical
  • Neuroanatomy: A Guide for Health Care Professionals.
  • Academic Press.
  • Nielsen, T. (2000). A review of mentation in REM and
  • NREM
  • sleep:
  • “Covert”
  • REM
  • sleep
  • as a possible
  • reconciliation of two opposing models. Behavioral and
  • Brain
  • Sciences,
  • 23(6),
  • 851-866.
  • https://doi.org/10.1017/S0140525X0000399X
  • Pallavicini, C., Cavanna, F., Zamberlan, F., De La Fuente,
  • L., Ilksoy, Y., Perl, Y. S., Arias, M. E., Romero, C. S.,
  • Carhart-Harris, R. L., Timmermann, C., & Tagliazucchi,
  • E. (2021b). Neural and subjective effects of inhaled
  • N,N-dimethyltryptamine in natural settings. Journal of
  • Psychopharmacology,
  • 35(4),
  • 406–420.
  • https://doi.org/10.1177/0269881120981384
  • Pitkanen, M. (2019). DMT, pineal gland, and the new view
  • about
  • sensory
  • perception.
  • Research
  • Gate.
  • https://doi.org/10.13140/RG.2.2.34968.55042
  • Samui, P., Roy, S. S., & Balas, V. E. (2017). Handbook of
  • Neural Computation. Academic Press.
  • Sha’abani, M., Fuad, N., Jamal, N., & Ismail, M. (2020).
  • kNN and SVM Classification for EEG: A Review. In
  • Lecture
  • notes
  • in
  • electrical
  • engineering.
  • Springer
  • Science+Business
  • Media.
  • https://doi.org/10.1007/978-981-15-2317-5_47
  • Steriade, M. M., & McCarley, R. W. (2013). Brainstem
  • Control of Wakefulness and Sleep. Springer Science &
  • Business Media.
  • Strassman, R. (2000). DMT: The Spirit Molecule: A
  • Doctor's Revolutionary Research into the Biology of
  • Near-Death and Mystical Experiences. Rochester, VT:
  • Simon and Schuster.
  • Tagliazucchi, E., Zamberlan, F., Cavanna, F., De La Fuente,
  • L., Romero, C. S., Perl, Y. S., & Pallavicini, C. (2021).
  • Baseline
  • Power
  • of
  • Theta
  • Oscillations
  • Predicts
  • Mystical-Type Experiences Induced by DMT in a Natural
  • Setting.
  • Frontiers
  • in
  • Psychiatry,
  • 12.
  • https://doi.org/10.3389/fpsyt.2021.720066
  • Statement of technology
  • The datasets used throughout this paper were extracted
  • from two studies: “N,N-dimethyltryptamine in natural
  • settings” (Pallavicini et al., 2021), and from “DEED: A
  • Dataset for Dream-related Emotion Research“ (Liu et al.,
  • 2022).
  • These include DMT and EEG sleep datasets
  • respectively, which are publicly available. Work on this
  • paper did not involve collecting data from any human
  • participants or animals. The original owner of the data and
  • code used in this research paper retains ownership of the
  • data and code during and after the completion of this study.
  • All the tables and figures were created by and belong to
  • the authors of this study. Part of the code has been adapted
  • by notebooks provided by the project supervisor, who
  • additionally provided the authors with assistance with
  • specific tasks during the process.
  • A generative language model (ChatGPT) was used to
  • improve the authors’ original content: specifically, it was
  • used for purposes of spell checking. No other typesetting
  • tools or services were used.