To help keep first responders safe, researchers have developed an artificial intelligence method that not only rapidly and remotely detects the powerful drug fentanyl, but also teaches itself to detect any previously unknown derivatives made in clandestine batches. The method uses infrared light spectroscopy and can be used in a portable, tabletop device.