Raman Activity Investigation and Utilization of Psilocybin
Mingyu Sun, Xiaoyu Zhao, Fandi Kong, Jinsong Wang, Yunchang Lu, Liang Tong
Journal of Raman Spectroscopy March 19, 2026 DOI: 10.1002/jrs.70133 via OpenAlex
Summary
AI-generated from the abstractA Raman spectroscopy method combined with machine learning can rapidly and non-destructively identify psilocybin, the psychoactive compound in magic mushrooms. Theoretical Raman spectra predicted by density functional theory matched experimental spectra from fresh and heat-treated Psilocybe cubensis samples, establishing characteristic fingerprint features. Among feature extraction methods, competitive adaptive reweighted sampling (CARS) selected the most discriminative variables. An XGBoost model, optimized with Bayesian tuning and balanced via SMOTE, was integrated into a Bagging framework with KNN, SVM, and Decision Tree. The final model achieved 0.984 accuracy, 0.984 F1-score, and 0.976 ROC AUC, showing strong stability under storage conditions. This approach enables rapid, accurate, cost-effective, and contamination-free psilocybin detection for food safety and toxic mushroom screening.
Study at a glance
| Characteristics | Experimental study Peer reviewed |
|---|---|
| Population | Psilocybe cubensis mushroom samples |
| Topics | Psilocybin |
| Keywords | Raman spectroscopy Pattern recognition psychology Interpretability Sensitivity control systems |
| Key finding | A Bagging-based machine learning model integrating XGBoost, KNN, SVM, and Decision Tree achieved 0.984 accuracy and 0.976 ROC AUC for identifying psilocybin using Raman spectroscopy. |
Abstract
ABSTRACT Accidental ingestion of psilocybin‐containing mushrooms can cause poisoning and hallucinations, making their rapid detection a public health priority. Conventional methods such as HPLC, GC–MS, LC–MS, TLC, CE, and ELISA provide sensitivity but are often destructive, time‐consuming, or impractical for real‐time applications. This study introduces a Raman spectroscopy–based approach for rapid, nondestructive identification of psilocybin. The molecular geometry of psilocybin was optimized using density functional theory (B3LYP/6‐31G(d,p)), and theoretical Raman spectra were generated to assign characteristic vibrational peaks, confirming its Raman activity. Experimental spectra of fresh and heat‐treated Psilocybe cubensis mushroom samples were collected, with peak alignment demonstrating good agreement with theoretical predictions, thus establishing psilocybin fingerprint features. For classification, raw and preprocessed spectra (MSC, SNV, 1st‐D, detrending) were evaluated. Among feature extraction methods (PCA, SPA, UVE, CARS), CARS yielded the most discriminative variables. An XGBoost model was developed and optimized via Bayesian tuning, while SMOTE addressed class imbalance. Furthermore, psilocybin fingerprint features were fused with CARS features to enhance interpretability and model robustness. Finally, a Bagging framework integrating XGBoost, KNN, SVM, and Decision Tree was implemented to improve generalization and noise resistance. The final Bagging‐based model achieved high performance (accuracy 0.984, F1‐score 0.984, ROC AUC 0.976), with strong stability under storage conditions. Overall, this study elucidates psilocybin's Raman spectral characteristics and establishes a machine learning–assisted detection model. The approach enables rapid, accurate, cost‐effective, and contamination‐free identification of psilocybin, with potential applications in food safety monitoring and on‐site toxic mushroom screening.