Identifying Narcotics with a Pocket-Size Near-Infrared Spectrometer

Table of Content

Spectrometer, Experimental Design and Setup
     Sample Presentation and Data Acquisition
Results and Discussion
     Data Pretreatment
     Principal Component Analysis (PCA) analysis
     Support Vector Machine (SVM) Classification
     Conformity Testing
     Instrument to Instrument Reproducibility Results
     Mixtures and Detection Level


A major transformation is taking place in the infrared and optical spectroscopy sector. Quite like what happened in the computer sector, the weight and size of the instruments are decreasing from bench-top size to pocket-size. Total system costs are reducing, and the performance continues to move from ‘good-enough’ to approaching certain aspects of bench-top performance. These small handheld spectrometers are enabling a new generation of users taking measurements in the field by non-technical individuals whereby traditionally these tests have been performed in the laboratory by highly trained technicians. The tests are non-destructive and can be done in a few seconds, enabling the capability for real-time results leading to highly efficient decision making. Due to the low cost and ease of use of these new tiny devices, growing interest is being seen in areas of hazardous material responders and law enforcement.

Police officers, first responders, border patrol agents, or military personnel could use a tiny spectrometer to examine suspicious substances that may be suspected lethal or illegal.

This article covers the performance of the world’s smallest, fully contained (detector, collection optics, light source, dispersing element, and control and readout electronics) NIR spectrometer, the MicroNIR™ Spectrometer, to establish the viability of using the device to correctly categorize common illicit substances, explosives, and confusants. The MicroNIR spectrometer is powered and controlled with a smart mobile device, such as a tablet, a smartphone, and phablet.

The National Forensic Science Technology Center (NFSTC) in Largo, FL was asked to collect a library of spectral scans to assess the potential of the MicroNIR miniature spectrometer for forensic identification of controlled substances, pharmaceuticals, diluents, and other chemicals. Near infrared spectroscopy is a non-destructive and confirmatory method that can be applied to identify many types of forensics samples. Traditionally, it is equipment that is restricted to a laboratory environment, but the handheld and miniature design of the MicroNIR, without the restrictions of moving parts, opens this technology to non-traditional environments such as first responders and law enforcement.

This research was done in two phases; 1) a library development phase and 2) a conformity analysis of the developed calibration and performance assessment spanning three different MicroNIR spectrometers.

Phase I involved scanning of a large number of drug and drug-related compounds so as to build a classification library which includes the top drugs reported by forensic laboratories as published in the DEA sponsored NFLIS report of 2010 [1]. Extra controlled substances and pharmaceuticals were included, as well as diluents, precursors, and other common chemicals.

Phase II of the testing happened after the preliminary data analysis and classification algorithms were developed at JDSU. NFSTC evaluated the MicroNIR for accuracy (conformity) using a sub-set of 25 previously run samples. The three spectrometers used for phase two included the original instrument used for calibration development (Serial number S1- 2012-0048T) and two new production units (Serial numbers S1-00129 and S1-00138).

In another study, researchers at Toegepaste Industriële Procesbeheersing (TIPb) in Amsterdam, The Netherlands, created models for detecting controlled substances that are present in street drugs. The models depended on scans and libraries of pure compounds only.

Spectrometer, Experimental Design and Setup


The MicroNIR spectrometer is a disruptive and enabling small spectrometer built to measure diffuse reflection spectra in the NIR region of the electromagnetic spectrum to be used for real-time, point-of-use NIR chemometrics applications. The small size of the MicroNIR is due to the novel thin-film linearly variable filter (LVF) used as the dispersive element versus traditional diffraction based spectrometers. The LVF is a dielectric thin-film Fabry-Perot bandpass filter deposited using energetic processes, well-known to create reliable and stable optical components [2]. The MicroNIR is illustrated in Figure 1 and more details as to the spectrometer design theory have been previously presented [3].

Figure 1. The MicroNIR spectrometer

The LVF filter coating used in the MicroNIR is purposely wedged in one direction. Since the center wavelength of the bandpass filter is a function of the coating thickness, the peak transmitted wavelength differs nonstop along the direction of the wedge. Figure 2 illustrates this working principle.

An illustration of the optical design and cross section of the MicroNIR operated in diffuse reflection mode.

Figure 2. An illustration of the optical design and cross section of the MicroNIR operated in diffuse reflection mode.

Main attributes of the MicroNIR 1700 spectrometer are summarized in Table 1. For applications in point-of-use and process analytical technology (PAT), measurement reproducibility among numerous MicroNIR spectrometers as well as repeatability of measurements on each MicroNIR are properly understood and documented in an earlier publication[4].

Table 1. Key performance attributes of the MicroNIR 1700 spectrometer

. .
Weight 60 grams
Dimensions 45 mm diameter x 42 mm height
Spectral Range MicroNIR 1700: 950-1650 nm
Number of pixels 128 pixels, 125 point standardized grid
Optical Resolution <1.25% of center wavelength, i.e. at 1000 nm wavelength, resolution is <12.5 nm
Geometric Resolution 6.25 nm per pixel
Wavelength Accuracy < 3 nm, as compared to NIST SRM-2036
Wavelength Repeatability < 1 nm, as compared to NIST SRM-2036
Power Requirement USB powered, < 500 mA at 5 V
Operating Temperature -20 °C to 40 °C

Sample Presentation and Data Acquisition

One of the difficulties in measuring street narcotics is that the sample size is very small. This presents difficulties for a number of analytical technologies. To raise the probability of success, a reproducible sampling protocol and presentation capable of accepting a wide range of material volumes was explored and then developed. The final sample presentation that produced the maximum reproducibility across sample volumes was the use of a polyethylene bag with an X heat sealed onto the bag producing a symmetrical pocket. Figure 3 shows this ‘X-bag’.

3. Sample in �X-bag� and placement on the MicroNIR

Figure 3. Sample in ‘X-bag’ and placement on the MicroNIR

The MicroNIR 1700 was used to scan 140 compounds at NFSTC with the windowed collar sampling accessory which contains an integrated sapphire window to maintain a steady sample-to-spectrometer distance. A 99% diffuse reflectance panel was employed as the spectrometer’s 100% reference value. The system ‘zero’ was collected with no sample in the spectrometer field of view. An integration time of nine minutes and a spectrum averaging of 50 was used for all spectral acquisitions. Spectrum averaging denotes the number of single scans averaged together to represent a single spectrum acquisition. Spectrum averaging seeks to enhance overall spectrum signal-to-noise ratio.

The samples were transferred into the ‘X-Bags’ and the 99% reflectance panel was kept on top of the sample X-bag to act as a backer to diminish any light loss. The use of the backer serves to increase the overall measurement signal-to-noise on a small volume sample. Some of the materials measured were dark in color. For these materials, the instrument 100% reference values were gathered using both a 99% and 50% diffuse reflectance panel. Use of the 50% reference panel seeks to make the most of the spectral characteristics of the dark materials. For each of the 140 materials, five replicate scans were gathered to account for any sampling and sample volume variation.

After data acquisition, the spectra were imported into The Unscrambler® X software version 10.2 manufactured by CAMO Software AS in Woodbridge, NJ for spectral testing and calibration model development.

After the development of a predictive calibration model, extra conformity spectra were collected on three different MicroNIR spectrometers to serve as a test set for model performance. Out of the 140 samples that were scanned, 25 were scanned at a later date from the original calibration data acquisition. Three spectrometers were used to examine direct calibration transfer where the model is deployed on data from a different spectrometer without any data manipulation.

Results and Discussion

Data Pretreatment

This study’s spectra were gathered in diffuse reflection mode and then transformed to absorbance. Spectral variation was seen and was believed to be dominated by baseline shifts due to sample placement on the spectrometer. Consequently, a Savitzky-Golay 1st derivative (five-point smoothing) was applied first to emphasize small changes in the spectra followed by a Standard Normal Variate (SNV) correction to reduce the baseline variances arising from sample volume variances in the X-bags. Both data pretreatments are generally used with NIR spectra [5]. Figures 4 and 5 illustrate the pre- and post-treated spectra.

Untreated absorbance spectral dataset

Figure 4. Untreated absorbance spectral dataset

Savitzky-Golay 1st Derivative and Standard Normal Variate treatment of spectral dataset

Figure 5. Savitzky-Golay 1st Derivative and Standard Normal Variate treatment of spectral dataset

From the plot of transformed data in Figure 5, one can see that the baseline variability is minimized, and substance-specific features in the spectra are further enhanced.

Principal Component Analysis (PCA) analysis

A Principal Component Analysis (PCA) was completed on the treated spectra to comprehend how the different materials differentiated between each other as well as comprehend the spectral repeatability of the within-sample replicate spectral acquisitions. The results of this PCA analysis are witnessed in the 2D score plot seen in Figure 6. The PCA plot reveals there is in fact grouping of samples as well as the obvious separation of all materials. Besides the sample grouping, there also appears to be regional clustering with chemically similar materials such as cannabinols, hormones, and others. These results, though needing additional performance validation, propose the strong likelihood of success in differentiating among these materials.

Principal Component Analysis 2D score plot of pre-treated spectral dataset

Figure 6. Principal Component Analysis 2D score plot of pre-treated spectral dataset

Support Vector Machine (SVM) Classification

Support Vector Machine (SVM) is a linear classifier that chooses a hyper-plane based on exploiting the separation margin between classes. Its solution only relies on a small subset of training examples (support vectors). It can be easily stretched to nonlinear separation through the kernel machines scheme [6].

SVM has the benefit that it can manage datasets that are heterogeneously or multimodal structured in each of its classes. With its kernel mapping method, SVM can integrate previous knowledge into the spectral modeling. Unlike certain classifiers that have to alter parameters for every class in the model (e.g. PC factors and prediction thresholds for Soft Independent Modeling of Class Analogy (SIMCA)), there are just one to two parameters which need to be modified and in many cases the default settings are adequate. Use of a minimal set of modifiable parameters aims to prevent models from over-fitting and also reduces the overall model generation time. This has also been revealed to validate excellent calibration transfer results through its excellent generalization capability.

The Linear C-SVM (classification SVM) algorithm in the Unscrambler software was used to process the spectral dataset. The resulting classification model of the 140 different compounds produced a 99.75% training set self-prediction accuracy and a 99.76% training set cross validation accuracy (where a percentage of training set samples were kept aside as prediction set and the rest of the samples used to construct model and this process continued for numerous times and the average prediction success rate was then reported).

Conformity Testing

After the development of the SVM classification model, the subgroup of 25 samples was predicted for material conformity. The resulting 125 spectra were processed via the calibration model and the prediction results are listed out in Table 2 for the master calibration instrument (serial number S1-2012-0048T). One misclassification happened revealing an accuracy of 96%, but upon additional assessment of the misclassified spectra, the absorbance values are well outside of the model calibration set signifying an error in spectral acquisition. The final result is a 24/24 classification accuracy producing 100% accuracy.

Table 2. Prediction results for master calibration MicroNIR serial number S1-2012-0048T

Unknown File ID Predicted Known ID Match
0048T_01_1 Diltiazem_HCl Diltiazem HCl Yes
0048T_02_1 Inositol Inositol Yes
0048T_03_1 Niacinamide Niacinamide Yes
0048T_04_1 Procaine_HCl Procaine HCl Yes
0048T_05_1 Pseudoephedrine_base Pseudoephedrine base Yes
0048T_06_1 d,l-Amphetamine_sulfate D,l-amphetamine sulfate Yes
0048T_07_1 Carisoprodol Carisoprodol Yes
0048T_08_1 Cocaine_HCl Cocaine HCl Yes
0048T_09_1 Hydromorphone_HCl Hydromorphone HCl Yes
0048T_10_1 Methylphenidate_HCl Methylphenidate HCl Yes
0048T_11_1 Oxycodone_HCl Oxycodone HCl Yes
0048T_12_1 Cannabinol Cannabinol Yes
0048T_13_1 Methylphenidate_HCl Methamphetamine HCl Yes
0048T_14_1 Testosterone_acetate Testosterone Acetate Yes
0048T_15_1 TFMpp_HCl Tfmpp HCl Yes
0048T_16_1 AM2201 AM2201 Yes
0048T_17_1 HU-211 HU-211 Yes
0048T_18_1 JWH-251 JWH-251 Yes
0048T_19_1 4-Butylone HCl 4-Butylone HCl Yes
0048T_20_1 3-Fluoromethcathinone HCl 3-fluoromethcathinone Yes
0048T_21_1 5-Methoxy_DALT 5-Methoxy DALT Yes
0048T_22_1 Levamisol_HCl Levamisol HCl Yes
0048T_23_1 Acetaminophen Acetaminophen Yes
0048T_24_1 D-(+)-Glucose Dimethyl sulfone No
0048T_25_1 Pentobarbital Pentobarbital Yes
Accuracy 96%

Instrument to Instrument Reproducibility Results

After the conformity testing of the basic MicroNIR, two extra MicroNIR spectrometers (serial numbers (S1- 00129 and S1-00138) were also used to scan the illegal material conformity samples. Tables 3 and 4 show the results of each instrument prediction.

Table 3. Prediction results for target MicroNIR serial number S1-00129

Unknown File ID Predicted Known ID Match
0129_01_1 Methylone_HCl Diltiazem HCl X
0129_02_1 Inositol Inositol Y
0129_03_1 Niacinamide Niacinamide Y
0129_04_1 Procaine_HCl Procaine HCl Y
0129_05_1 Pseudoephedrine_base Pseudoephedrine base Y
0129_06_1 d,l-Amphetamine_sulfate D,l-amphetamine sulfate Y
0129_07_1 Carisoprodol Carisoprodol Y
0129_08_1 Cocaine_HCl Cocaine HCl Y
0129_09_1 Hydromorphone_HCl Hydromorphone HCl Y
0129_10_1 Naphyrone_HCl Methylphenidate HCl X
0129_11_1 Oxycodone_HCl Oxycodone HCl Y
0129_12_1 Cannabinol Cannabinol Y
0129_13_1 Naphyrone_HCl Methamphetamine HCl X
0129_14_1 Testosterone_acetate Testosterone Acetate Y
0129_15_1 TFMpp_HCl Tfmpp HCl Y
0129_16_1 AM2201 AM2201 Y
0129_17_1 HU-211 HU-211 Y
0129_18_1 JWH-251 JWH-251 Y
0129_19_1 4-Butylone HCl Butylone HCl Y
0129_20_1 4-Fluoromethcathinone 3-fluoromethcathinone X
0129_21_1 5-Methoxy_DALT 5-Methoxy DALT Y
0129_22_1 Levamisol_HCl Levamisol HCl Y
0129_23_1 Acetaminophen Acetaminophen Y
0129_24_1 Dimethyl_sulfone Dimethyl sulfone Y
0129_25_1 Pentobarbital Pentobarbital Y
Accuracy 84%

Table 4. Prediction results for target MicroNIR serial number S1-00138

Unknown File ID Predicted Known ID Match
0138_01_1 Methylone_HCl Diltiazem HCl N
0138_02_1 Inositol Inositol Y
0138_03_1 Niacinamide Niacinamide Y
0138_04_1 Procaine_HCl Procaine HCl Y
0138_05__1 Pseudoephedrine_base Pseudoephedrine base Y
0138_06__1 d,l-Amphetamine_sulfate D,l-amphetamine sulfate Y
0138_07_1 Carisoprodol Carisoprodol Y
0138_08_1 Cocaine_HCl Cocaine HCl Y
0138_09_1 Hydromorphone_HCl Hydromorphone HCl Y
0138_10_1 Naphyrone_HCl Methylphenidate HCl Y
0138_11_1 Oxycodone_HCl Oxycodone HCl Y
0138_12_1 Cannabinol Cannabinol Y
0138_13_1 Naphyrone_HCl Methamphetamine HCl N
0138_14_1 Testosterone_acetate Testosterone Acetate Y
0138_15_1 TFMpp_HCl Tfmpp HCl Y
0138_16_1 AM2201 AM2201 Y
0138_17_1 HU-211 HU-211 Y
0138_18_1 JWH-251 JWH-251 Y
0138_19_1 4-Butylone HCl Butylone HCl Y
0138_20_1 4-Fluoromethcathinone 3-fluoromethcathinone N
0138_21_1 5-Methoxy_DALT 5-Methoxy DALT Y
0138_22_1 Levamisol_HCl Levamisol HCl Y
0138_23_1 Acetaminophen Acetaminophen Y
0138_24_1 Dimethyl_sulfone Dimethyl sulfone Y
0138_25_1 Pentobarbital Pentobarbital Y
Accuracy 88%

The instrument to instrument reproducibility results indicate promise implementing a direct calibration transfer to enable easy adoption of future new systems. The three spectrometers used in this trial included an initial beta system and two early manufacturing build systems which were known to have diverse differences in manufacturing and are the causes for some of the misclassifications. This information was then utilized for developing instrument specification for researchers to target as a way to enable more effective method and library transfer from a master instrument to a number of other target instruments. Since this study was concluded at NFSTC, system-to-system reproducibility has been greatly improved as reported in a recent publication [4].

Mixtures and Detection Level

In several cases, prohibited substances are mixtures of pure components. In cases of prohibited street drugs, the mixture comprises of the active or controlled component (e.g. heroin, cocaine, or amphetamine) and cutting agents (e.g. paracetamol sucrose, caffeine, or lidocaine). Identification of these powder mixtures is difficult due to the wide number of mixture components. Also, the cutting agents and active components found in street drugs differ with time and location. For instance, new designer drugs are being launched into the market every week. In Europe, components of cocaine vary from that sold in the USA. Traditional qualitative or quantitative models are frequently based on a design of known constituents with pre-designed concentrations. Taking into consideration the practical issues of illegal substances, the construction of traditional models requires numerous samples and is thus too costly and time consuming.

A calibration-free approach based on the concept of the net analyte signal (NAS) to identify powder mixtures [7] is proposed. This method depends on expert knowledge about the main mixture components of a specific category of substances. In the primary step, a specific category of illegal substances is defined, e.g. heroin or cocaine. Based on expert knowledge, these key categories are “filled” with library components. These library components are pure substance components which can be found together as blends. Once a category is exactly documented with its library components, NIR spectra are gathered for each library component. The subspace spanned by these library components is applied for the identification model.

For an unidentified sample, the NAS signal is calculated by projecting the unidentified sample to the subspace spanned by the library components. The NAS for an unidentified sample is the spectral response which is orthogonal to the spectra of the other library components. Next, the NAS vector is used to forecast the composition of the unidentified sample.

A few library components were measured with MicroNIR serial number S1-2012-116. This specific MicroNIR unit is located in Amsterdam, The Netherlands. The library components are part of four illicit substance matrices: cocaine, XTC, heroin, and amphetamine. These matrices were built based on the composition of street drugs generally found in The Netherlands. From the matrices and its library components, an identification model was built dedicated to identify street drugs.

Next, several street drug samples were tested using MicroNIR S1-2012-116 by positioning the sample directly on the window collar. The physical appearance of these street drug samples differs from lumps to fine powders or intact tablets. For law enforcement reasons, it is crucial to identify the controlled substance for a specific sample. Also, the model also gives information about the presence of cutting agents. In this way, a more complete identification result can be achieved. Such information is ideal for tactical data purposes e.g., to examine if different samples originate from the same supplier.

Accordingly the identification model is used to calculate the composition of the street drug samples. The street drugs identification model is built to reduce false positives. Moreover, the detection limit of a component in a mixture is about 15 w/w% (based on the complexity of the mixture). Table 5 shows the identification results in the second column.

For each street drug sample, the composition was established using GC-MS. The third column of Table 5 signifies the outcomes of the GC-MS measurements. The weight percentage of each identified component is also listed. A weight percentage listed as (x) means the components weight percentage was < 5 w/w%.

From Table 5, it can be observed that the identification model is really capable in identifying controlled substances in multi-component mixtures. Furthermore, a total of 150 street drug samples were tested, resulting in 1.5% false negatives and 2% false positives. 28% of all samples had controlled substances with weight percentages < 10 w/w%. These samples represented heroin samples having small quantities of the controlled substance (heroine) and caffeine + paracetamol as cutting agents.

Table 5. Identification results for MicroNIR serial number S1-0116T

Unknown File ID Predicted Known ID (w/w%)
S1-0116T_1 CocaineHCL | Levamisol Levamisol (15) | Cocaine (70)
S1-0116T_2 Caffeine | CocaineHCL | Phenacetine Caffeine (5) | Cocaine (44) | Phenacetine (35) | By-products (x) | Lidocaine (x)
S1-0116T_3 Caffeine | HeroinBASE | Paracetamol Caffeine(24) | Heroin (11) | Paracetamol (x) | Noscapine (x) | Papaverine (x) | 6-acetylcodeine (x)
S1-0116T_4 Caffeine | Paracetamol Caff (33) | Paracetamol (x)
S1-0116T_5 Cellulose | MDMAHCL | Talcum MDMA (29)
S1-0116T_6 Amfetamine | Caffeine | Sucrose Caff (78) | Amf (6) | Unknown (x)
S1-0116T_7 Phenacetine Phenacetine (94)
S1-0116T_8 CocaineHCL | Phenacetine. Caffeine (1) | Amfetamine (7) | Levamisol (3) | Cocaine (34) | Phenacetine (24).
S1-0116T_9 Cellulose | Talcum Caffeine (4) | MDMA (5).
S1-0116T_10 Caffeine | Paracetamol. Caffeine (30) | Heroïn (6) | Paracetamol (x) | Noscapine (x) | 6-acetylcodeine (x).

The result of the identification model shows that the MicroNIR unit can provide sufficient distinctive spectral information for an extensive range of prohibited drug components. In the near future, the MicroNIR S1-2012-116 will be tested as a master tool within a large field-test in the Netherlands. 15 other MicroNIR analyzers are being employed in a cloud-computing environment by police officers to detect unidentified mixtures in their routine work.


The researchers have shown that the MicroNIR spectrometer weighing < 60 grams (3 ounces) is able to identify controlled substances found in street drugs with a very low error rate of prediction. By joining innovations in small NIR spectroscopy and multivariate analysis, and leveraging the universal smart devices and cloud computing, the MicroNIR spectrometer is a game changer for law enforcement agents, drug enforcement agents, and Interpol.


JDSU would like to thank Joan Ring and all other employees at NFSTC for their assistance with the data acquisition for this project.


[1] National Forensic Laboratory Information System (NFLIS) 2010 Annual Report, retrieved from:

[2] Macleod, H.A., [Thin-Film Optical Filters], Fourth Edition, CRC Press, Boca Raton, FL, 302-369, 490-513 (2010).

[3] O’Brien, N., Hulse, C., Friedrich, D., Van Milligen, F., von Gunten, M., Pfeifer, F., Siesler, H., “Miniature NearInfrared (NIR) Spectrometer Engine For Handheld Applications.” Proc. SPIE, Ed. M. Druy, and R. Crocombe, 8374, p 837404-1-8 (2012). [4] Friedrich, D., Hulse, C., von Gunten, M., Williamson, E., Pederson, C., O'Brien, N., “Miniature near-infrared spectrometer for point-of-use chemical analysis.” Proc. SPIE, Ed. Y. Soskind and G. Olson, 8992 (2014).

[5] Anderson, C.A., Drennen, J.K., Ciurczak, E.W., [Handbook of Near-Infrared Analysis], Burns, D. A and Ciurczak E. W. (editors), 3rd Edition, CRC Press, Boca Raton, USA, 585-611 (2008). Proc. of SPIE Vol. 9101 91010O-10

[6] C.-C. Chang and C.-J. Lin. LIBSVM : a library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1--27:27, 2011.

[7] Lorber, A., Faber, K.., Kowalski, B.R., “Net analyte signal calculation in multivariate calibration”, Anal. Chem. (69), 1620-1626 (1997).

This information has been sourced, reviewed and adapted from materials provided by Viavi Solutions.

For more information on this source, please visit Viavi Solutions.

Tell Us What You Think

Do you have a review, update or anything you would like to add to this article?

Leave your feedback