Abstract A method using spectral information to detect substances in mixtures is given. The presented convolutional neural network is using three-dimensional convolutions to process hyperspectral images. Reflectance values can be fed directly into the network and are not preprocessed. Due to the architecture, the neural network performs a spatially invariant operation. Detection performance is demonstrated by a dataset containing spice mixtures.