Illicium verum (Chinese star anise) dried fruit is popularly used as a remedy to treat infant colic. However, instances of life-threatening adverse events in infants have been recorded after use, in some cases due to substitution and/or adulteration of I. verum with I. anisatum (Japanese star anise) which is toxic. It is evident that rapid and efficient quality control methods are of utmost importance to prevent re-occurrence of such dire consequences. The potential of short wave infrared (SWIR) hyperspectral imaging and image analysis as a rapid quality control method to distinguish between I. anisatum and I. verum whole dried fruit was investigated. Images were acquired using a sisuChema SWIR hyperspectral pushbroom imaging system with a spectral range of 920-2514 nm. Principal component analysis (PCA) was applied to the images to reduce the high dimensionality of the data, remove unwanted background and to visualise the data. A classification model with 4 principal components and an R2X_cum of 0.8438 and R2Y_cum of 0.8139 was developed for the two species using partial least squares discriminant analysis (PLS-DA). The model was subsequently used to accurately predict the identity of I. anisatum (98.42%) and I. verum (97.85%) introduced into the model as an external dataset. The results show that hyperspectral imaging is an objective and non-destructive quality control method that can be successfully used to identify whole dried fruit of I. anisatum and I. verum. In addition, this method has the potential to detect I. anisatum whole dried fruits within large batches of I. verum through upscaling to a conveyor belt system.