Random forest models accurately classify synthetic opioids using high-dimensionality mass spectrometry datasets

Abstract

Detection of novel threat agents presents several challenges, a principle one being the development of untargeted methods to screen an increasing number of threat chemicals whose exact structures are unknown. With the use of Machine Learning (ML) tools, we can guide the development of analytical methods for broad-spectrum detection of unbounded threat chemical families in complex mixtures. Toward this goal, we used nominal mass and high-resolution mass spectrometry data for hundreds of synthetic opioids and non-opioid compounds. We tested two ML techniques, logistic regression and random forest, to develop models towards a practical, implementable method for opioid detection. We found that of these tested ML methods, random forest models resulted in the highest validation accuracy (95+%) for both nominal mass and high-resolution classification of opioids versus non-opioids, with low false positive and false negative rates. The RF models were then used to successfully predict the classification of 10 compounds—five opioids and five non-opioids not part of the training and validation analysis. This application of ML is a critical step towards the development of field-deployable nominal mass spectrometers with ML-driven analyses for classification of emergent threats.

Graphical abstract: Random forest models accurately classify synthetic opioids using high-dimensionality mass spectrometry datasets

Supplementary files

Article information

Article type
Paper
Submitted
07 Oct 2025
Accepted
29 Dec 2025
First published
07 Jan 2026
This article is Open Access
Creative Commons BY license

Anal. Methods, 2026, Advance Article

Random forest models accurately classify synthetic opioids using high-dimensionality mass spectrometry datasets

K. Arasteh, S. Magana-Zook, C. V. Ponce, R. Leif, A. Vu, M. Dreyer, B. P. Mayer, A. M. Williams and C. L. Fisher, Anal. Methods, 2026, Advance Article , DOI: 10.1039/D5AY01677K

This article is licensed under a Creative Commons Attribution 3.0 Unported Licence. You can use material from this article in other publications without requesting further permissions from the RSC, provided that the correct acknowledgement is given.

Read more about how to correctly acknowledge RSC content.

Social activity

Spotlight

Advertisements