Non-destructive assessment of cannabis quality during drying process using hyperspectral imaging and machine learning

Front Plant Sci. 2024 Apr 26:15:1365298. doi: 10.3389/fpls.2024.1365298. eCollection 2024.


Cannabis sativa L. is an industrially valuable plant known for its cannabinoids, such as cannabidiol (CBD) and Δ9-tetrahydrocannabinol (THC), renowned for its therapeutic and psychoactive properties. Despite its significance, the cannabis industry has encountered difficulties in guaranteeing consistent product quality throughout the drying process. Hyperspectral imaging (HSI), combined with advanced machine learning technology, has been used to predict phytochemicals that presents a promising solution for maintaining cannabis quality control. We examined the dynamic changes in cannabinoid compositions under diverse drying conditions and developed a non-destructive method to appraise the quality of cannabis flowers using HSI and machine learning. Even when the relative weight and water content remained constant throughout the drying process, drying conditions significantly influenced the levels of CBD, THC, and their precursors. These results emphasize the importance of determining the exact drying endpoint. To develop HSI-based models for predicting cannabis quality indicators, including dryness, precursor conversion of CBD and THC, and CBD : THC ratio, we employed various spectral preprocessing methods and machine learning algorithms, including logistic regression (LR), support vector machine (SVM), k-nearest neighbor (KNN), random forest (RF), and Gaussian naïve Bayes (GNB). The LR model demonstrated the highest accuracy at 94.7-99.7% when used in conjunction with spectral pre-processing techniques such as multiplicative scatter correction (MSC) or Savitzky-Golay filter. We propose that the HSI-based model holds the potential to serve as a valuable tool for monitoring cannabinoid composition and determining optimal drying endpoint. This tool offers the means to achieve uniform cannabis quality and optimize the drying process in the industry.

Keywords: cannabidiol; classification; logistic regression; postharvest quality control; tetrahydrocannabinol.

Grants and funding

The author(s) declare financial support was received for the research, authorship, and/or publication of this article. This work was supported by a Korea Institute of Science and Technology Intramural Research grant (2Z06831).