A Prototype Sensor-Based System with Machine Learning for Cannabis Strain Classification via VOC Signatures

Authors

  • Suparat Sasrimuang Faculty of Engineering, Ubon Ratchathani University, Thailand
  • Thanyathorn Ninduangdee Faculty of Engineering, Ubon Ratchathani University, Thailand
  • Teerapat Khottarin Faculty of Engineering, Ubon Ratchathani University, Thailand
  • Suchin Trirongjitmoah Faculty of Engineering, Ubon Ratchathani University, Thailand
  • Nisarut Phansiri Faculty of Engineering, Ubon Ratchathani University, Thailand

DOI:

https://doi.org/10.55003/ETH.420304

Keywords:

Cannabis strain classification, Volatile organic compounds (VOCs), Gas sensor array, Electronic nose, Machine learning

Abstract

Cannabis strain classification is essential for ensuring product consistency, therapeutic accuracy, and quality control in both medical and commercial applications. This study presents the development of a prototype sensor-based system for classifying three cannabis strains—Black Patronas (Hybrid), MAC Gold (Indica), and Banana Daddy R1 (Sativa)—by analyzing odors emitted from dried flowers and leaves. A gas sensor array consisting of five low-cost sensors (MQ-2, MQ-3, MQ-6, TGS-822, and TGS-826) was employed to detect volatile organic compounds (VOCs) characteristic of each strain. Sensor signals were acquired using an Arduino Mega 2560, preprocessed via Node-RED, stored in InfluxDB, and visualized using Grafana. To enable classification, differential responses (ΔR) were computed by subtracting baseline analog values from VOC exposures. These ΔR values were used to train a Random Forest classifier, which achieved an accuracy of 83% on unseen test samples. Notably, MQ-2 showed strong response to Hybrid flowers, while TGS-822 was most effective for detecting VOCs from Sativa leaves. While the dataset was limited in size, the system demonstrated reliable classification across six cannabis sample types. These results confirm the feasibility of using low-cost sensor arrays with interpretable ML models for odor-based strain identification. Future work will expand the dataset, explore additional algorithms, and move toward real-time, portable deployment for cannabis quality assurance.

References

Z. Haddi, A. Amari, H. Alami, N. El Bari, E. Llobet and B. Bouchikhi, “A portable electronic nose system for the identification of cannabis-based drugs,” Sensors and Actuators B: Chemical, vol. 155, no. 2, pp. 456–463, 2011, doi: 10.1016/j.snb.2010.12.047.

D. Jin, P. Henry, J. Shan and J. Chen, “Classification of cannabis strains in the Canadian market with discriminant analysis of principal components using genome-wide single nucleotide polymorphisms,” PLoS ONE, vol. 16, no. 6, 2021, Art. no. e0253387, doi: 10.1371/journal.pone.0253387.

J. M. McPartland and G. W. Guy, “Models of Cannabis Taxonomy, Cultural Bias, and Conflicts between Scientific and Vernacular Names,” The Botanical Review, vol. 83, no. 4, pp. 327–381, 2017, doi: 10.1007/s12229-017-9187-0.

N. Herwig, S. Utgenannt, F. Nickl, P. Möbius, L. Nowak, O. Schulz and M. Fischer, “Classification of Cannabis Strains Based on their Chemical Fingerprint—A Broad Analysis of Chemovars in the German Market,” Cannabis and Cannabinoid Research, vol. 10, no. 3, 2024, doi: 10.1089/can.2024.0127.

G. Knight, S. Hansen, M. Connor, H. Poulsen, C. McGovern and J. Stacey, “The results of an experimental indoor hydroponic cannabis growing study, using the ‘Screen of Green’ (ScrOG) method—Yield, tetrahydrocannabinol (THC) and DNA analysis,” Forensic Science International, vol. 202, no. 1–3, pp. 36–44, 2010, doi: 10.1016/j.forsciint.2010.04.022.

J. Sawler, J. M. Stout, K. M. Gardner, D. Hudson, J. Vidmar, L. Butler, J. E. Page and S. Myles, “The Genetic Structure of Marijuana and Hemp,” PLoS ONE, vol. 10, no. 8, 2015, Art. no. e0133292, doi: 10.1371/journal.pone.0133292.

R. Zimmerleiter, W. Greibl, G. Meininger, K. Duswald, G. Hannesschläger, P. Gattinger, M. Rohm, C. Fuczik, R. Holzer and M. Brandstetter, “Sensor for Rapid In-Field Classification of Cannabis Samples Based on Near-Infrared Spectroscopy,” sensors, vol. 24, no. 10, 2024, Art. no. 3188, doi: 10.3390/s24103188.

L. Ambach, F. Penitschka, A. Broillet, S. König, W. Weinmann and W. Bernhard, “Simultaneous quantification of delta-9-THC, THC-acid A, CBN and CBD in seized drugs using HPLC-DAD,” Forensic Science International, vol. 243, pp. 107–111, 2014, doi: 10.1016/j.forsciint.2014.06.008.

L. Nahar, M. Guo and S. D. Sarker, “Gas chromatographic analysis of naturally occurring cannabinoids: A review of literature published during the past decade,” Phytochemical Analysis, vol. 31, no. 2, pp. 135–146, 2019, doi: 10.1002/pca.2886.

MyDx Analyzer/Sensor—Electronic Nose Technology, MyDx Inc., Mar. 2025. [Online]. Available: https://www.mydxlife.com/mydx-analyzer-sensor/

H. Hendrick, H. Humaira, S. Yondri, H. Afdhal and D. Rahmatullah, “Dry Cannabis Detection by Using Portable Electronic Nose,” in 2022 5th International Seminar on Research of Information Technology and Intelligent Systems (ISRITI), Yogyakarta, Indonesia, Dec. 8–9, 2022, pp. 378–383, doi: 10.1109/ISRITI56927.2022.10053031.

L. S. Leite, V. Visani, P. C. F. Marques, M. A. B. L. Seabra, N. C. L. Oliveira, P. Gubert, V. W. C. de Medeiros, J. O. de Albuquerque and J. L. L. Filho, “Design and implementation of an electronic nose system for real-time detection of marijuana,” Instrumentation Science & Technology, vol. 49, no. 5, 2021, doi: 10.1080/10739149.2021.1887213.

S. Rajora, D. K. Vishwakarma, K. Singh and M. Prasad, “CSgI: A Deep Learning based approach for Marijuana Leaves Strain Classification,” in 2018 IEEE 9th Annual Information Technology, Electronics and Mobile Communication Conference (IEMCON), Vancouver, Canada, Nov. 1–3, 2018, pp. 1–6, doi: 10.1109/IEMCON.2018.8615011.

K. Sriprateep, S. Khonjun, R. Pitakaso, T. Srichok, S. Sala-Ngam, Y. Srithep, S. Gonwirat, P. Luesak, S. Matitopanum, C. Chueadee, et al., “Hybrid Adaptive Multiple Intelligence System (HybridAMIS) for classifying cannabis leaf diseases using deep learning ensembles,” Smart Agricultural Technology, vol. 9, 2024, Art. no. 100535, doi: 10.1016/j.atech.2024.100535.

T. Islam, T. T. Sarker, K. R. Ahmed and N. Lakhssassi, “Detection and Classification of Cannabis Seeds Using RetinaNet and Faster R-CNN,” seeds, vol. 3, no. 3, pp. 456–478, 2024, doi: 10.3390/seeds3030031.

C. T. Wang, C. Wiedinmyer, K. Ashworth, P. C. Harley, J. Ortega and W. Vizuete, “Leaf enclosure measurements for determining volatile organic compound emission capacity from Cannabis spp.,” Atmospheric Environment, vol. 199, pp. 80–87, 2019, doi: 10.1016/j.atmosenv.2018.10.049.

V. Samburova, M. McDaniel, D. Campbell, M. Wolf, W. R. Stockwell and A. Khlystov, “Dominant volatile organic compounds (VOCs) measured at four cannabis growing facilities: Pilot study results,” Journal of the Air & Waste Management Association, vol. 69, no. 11, pp. 1267–1276, 2019, doi: 10.1080/10962247.2019.1654038.

I. D. Mienye and N. Jere, “A Survey of Decision Trees: Concepts, Algorithms, and Applications,” IEEE Access, vol. 12, pp. 86716–86740, 2024, doi: 10.1109/ACCESS.2024.3416838.

A. Navada, A. N. Ansari, S. Patil and B. A. Sonkamble, “Overview of use of decision tree algorithms in machine learning,” in 2011 IEEE Control and System Graduate Research Colloquium, Shah Alam, Malaysia, Jun. 27–28, 2011, pp. 37–42, doi: 10.1109/ICSGRC.2011.5991826.

W. S. Holmes, M. P. L. Ooi, Y. C. Kuang, R. Simpkin, I. Lopez-Ubiria, A. Vidiella, D. Blanchon, G. S. Gupta and S. Demidenko, “Classifying cannabis sativa flowers, stems and leaves using statistical machine learning with near-infrared hyperspectral reflectance imaging,” in Proc. IEEE Int. Instrumentation and Measurement Technology Conf. (I2MTC), pp. 1–6, 2020, doi: 10.1109/I2MTC43012.2020.9129531.

Downloads

Published

2025-09-10

How to Cite

[1]
S. Sasrimuang, T. Ninduangdee, T. Khottarin, S. Trirongjitmoah, and N. Phansiri, “A Prototype Sensor-Based System with Machine Learning for Cannabis Strain Classification via VOC Signatures”, Eng. & Technol. Horiz., vol. 42, no. 3, p. 420304, Sep. 2025.

Issue

Section

Research Articles