Hyperspectral images contain very useful information because of their high spectral resolution, which can be used for non-contact food testing. However, to process them with convolutional neural networks, large data sets are needed. This is especially true if the data is not preprocessed and therefore of high dimension. However, relatively few hyperspectral data sets exist. To solve this problem, the neural network can be pre-trained using an autoencoder, which compresses and reconstructs the image. By minimizing the reconstruction error, useful features can be learned to solve the original task. In this work, spice mixtures are used to investigate whether individual components can be detected. In particular, a neural network using a 3D convolutional autoencoder is trained with a small data set.