Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Jul;70(4):1315-1328.
doi: 10.1111/1556-4029.70058. Epub 2025 Apr 18.

Identification of non-glandular trichome hairs in cannabis using vision-based deep learning methods

Affiliations

Identification of non-glandular trichome hairs in cannabis using vision-based deep learning methods

Alon Zvirin et al. J Forensic Sci. 2025 Jul.

Abstract

The detection of cannabis and cannabis-related products is a critical task for forensic laboratories and law enforcement agencies, given their harmful effects. Forensic laboratories analyze large quantities of plant material annually to identify genuine cannabis and its illicit substitutes. Ensuring accurate identification is essential for supporting judicial proceedings and combating drug-related crimes. The naked eye alone cannot distinguish between genuine cannabis and non-cannabis plant material that has been sprayed with synthetic cannabinoids, especially after distribution into the market. Reliable forensic identification typically requires two colorimetric tests (Duquenois-Levine and Fast Blue BB), as well as a drug laboratory expert test for affirmation or negation of cannabis hair (non-glandular trichomes), making the process time-consuming and resource-intensive. Here, we propose a novel deep learning-based computer vision method for identifying non-glandular trichome hairs in cannabis. A dataset of several thousand annotated microscope images was collected, including genuine cannabis and non-cannabis plant material apparently sprayed with synthetic cannabinoids. Ground-truth labels were established using three forensic tests, two chemical assays, and expert microscopic analysis, ensuring reliable classification. The proposed method demonstrated an accuracy exceeding 97% in distinguishing cannabis from non-cannabis plant material. These results suggest that deep learning can reliably identify non-glandular trichome hairs in cannabis based on microscopic trichome features, potentially reducing reliance on costly and time-consuming expert microscopic analysis. This framework provides forensic departments and law enforcement agencies with an efficient and accurate tool for identifying non-glandular trichome hairs in cannabis, supporting efforts to combat illicit drug trafficking.

Keywords: cannabis detection; colorimetric chemical tests; computer vision; cystoliths; deep learning; non‐glandular trichomes; synthetic cannabinoids.

PubMed Disclaimer

Conflict of interest statement

The authors declare no conflict of interest.

Figures

FIGURE 1
FIGURE 1
Examples of non‐glandular trichomes, cystolith (left), and non‐cystolith (right). Microscopic view with magnification 40. From Wissenschaftlicher Dienst, Stadtpolizei Zürich, Switzerland, with permission.
FIGURE 2
FIGURE 2
Samples of non‐glandular trichome hairs in cannabis (left) and non‐cannabis trichomes (right) from the dataset collected during this research. The images displayed here are cropped from the original, larger images. Typically, the genuine trichomes have a bear‐claw shape, whereas the non‐cannabis trichomes are narrower and more densely distributed.
FIGURE 3
FIGURE 3
Samples of original images and bounding box annotations from the data collected, used for training the object detectors. Top – genuine, non‐glandular trichome hairs in cannabis; bottom – trichome hairs on non‐cannabis plants.
FIGURE 4
FIGURE 4
Architecture of the basic CNN model. The network is designed for binary classification and accepts as input color images of size 1024 × 428. It consists of four convolutional blocks, each comprising a convolutional layer, batch normalization, a ReLU activation, and max‐pooling for down‐sampling. The feature map sizes are progressively reduced across layers, starting with 16 channels and ending with 128 channels in the final block. The output of the last pooling layer is flattened and passed through a fully connected module with two intermediate layers. Each fully connected layer is followed by a dropout for regularization and a ReLU activation. The final layer is a fully connected output layer with two neurons corresponding to the binary classification task.
FIGURE 5
FIGURE 5
Architecture of the deep layer aggregation (DLA) network. This network introduces a hierarchical structure with tree modules to aggregate features across multiple scales. Input color images with 512 × 214 pixel resolution are processed through three initial convolutional blocks. Each block consists of a convolution, batch normalization, and ReLU activation, outputting 16, 32, and 32 feature maps, respectively. The hierarchical core of the DLA consists of four tree modules. Each module contains multiple tree nodes, which aggregate features from previous layers using addition and/or concatenation operations via skip connections. The feature map dimensions progressively increase, with the tree modules producing 64, 128, 256, and 512 feature maps, respectively. After feature aggregation, the network applies a global average pooling layer, reducing the spatial dimensions of the feature maps. Two fully connected layers are used for classification. Dropout layers are incorporated after each fully connected layer to reduce overfitting. A final softmax activation outputs the probability scores for each class, with the class having the higher probability selected as the predicted label.
FIGURE 6
FIGURE 6
Decision scheme for class label prediction from the object detector models. The amount of labeled objects that were detected determines the class prediction. If equal, the detected object with the highest confidence determines the image's label. In cases with no detections, the class remains undecided, and the prediction is considered an incorrect result.
FIGURE 7
FIGURE 7
Two suggested options for multi‐stage decision strategies integrating object detectors with image classifiers. In both cases, the first stage is to run an object detector attempting to detect trichome hairs and label them as cannabis or non‐cannabis trichomes. In the two‐stage strategy (left), if the object detector fails, a whole‐image classifier is then applied. In the three‐stage strategy (right), if the first object detector fails, a lower‐threshold object detector is then run at the second stage, with the objective of outputting more candidate trichomes (having lower confidence levels). Next, if any trichome hairs are detected, a classifier is applied on their bounding boxes; otherwise, a whole‐image classifier is applied.
FIGURE 8
FIGURE 8
Correct YOLO detection of a cystolith from genuine cannabis material. YOLO outputs bounding boxes surrounding detected objects, each with a class label and a confidence value.
FIGURE 9
FIGURE 9
Correct DETR detection of non‐glandular trichome hairs on a non‐cannabis plant. DETR outputs bounding boxes surrounding detected objects, each with a class label and a confidence value.
FIGURE 10
FIGURE 10
Example of outputs of the object detection models on a genuine cannabis image. Displayed are correct YOLO detections (top, magenta‐colored bounding boxes) that DETR detected erroneously (bottom, red‐colored bounding box). This examples showcases the use of a lower YOLO threshold, resulting in multiple true detections of the same cystolith, but also an incorrect detection (top, green‐colored bounding box).

References

    1. Hanuš LO, Levy R, De La Vega D, Katz L, Roman M, Tomíček P. The main cannabinoids content in hashish samples seized in Israel and Czech Republic. Isr J Plant Sci. 2016;63(3):182–190. 10.1080/07929978.2016.1177983 - DOI
    1. Mechoulam R. The pharmacohistory of Cannabis sativa . In: Mechoulam R, editor. Cannabinoids as therapeutic agents. Boca Raton, FL: Chapman and Hall/CRC; 2019. p. 1–20. 10.1201/9780429260667-1 - DOI
    1. Liu FH, Hu HR, Du GH, Deng G, Yang Y. Ethnobotanical research on origin, cultivation, distribution and utilization of hemp (Cannabis sativa L.) in China. 2017. [cited 2024 July 14]. Available from: https://nopr.niscpr.res.in/handle/123456789/40123.
    1. Fleming MP, Clarke RC. Physical evidence for the antiquity of Cannabis sativa L. J Int Hemp Assoc. 1998;5(2):80–95.
    1. Li HL. An archaeological and historical account of cannabis in China. Econ Bot. 1974;28(4):437–448. 10.1007/bf02862859 - DOI

LinkOut - more resources