## 1 Introduction  
The use of versatile food processing equipment and the globalization of the food supply chain inevitably increase the risk of food contamination caused by extraneous impurities. Food safety incidents of peanut and other nuts found in wheat products has been reported worldwide several times, and has become a serious health threat to people allergic to nuts. On the other hand, peanut and other nuts are widely utilized as food ingredients in commercial food products, but in most cases, they are not clearly stated on the product labels. Hence, the demand to detect peanut and other nut contents in food products during the manufacturing process is of vital importance. However, the most common methods for peanut and nut detection in food are on the basis of traditional protein detection methods, such as real-time polymerase chain reaction (RT-PCR) [1] and enzyme-linked immunosorbent assay (ELISA) [2]. Although these analytical methods are sensitive (0.1 mg/kg) [3], they are also destructive, time-consuming, require skilled operators, and even produce byproducts that are unfriendly to the environment. Thus, these laboratory-based detection techniques cannot meet the demand of the majority of food factories for online detection of nuts contamination. Near-infrared (NIR) spectroscopy in conjunction with multivariate analysis, as one of the alternatives to the general physical and chemical detection methods, has the advantages of rapid and non-destructive inspection for food quality [4]. It can provide information about chemical compositions in food products based on that various peaks in the spectrum that are related to the bending and stretching of chemical bonds involving O-H, S-H, N-H, and C-H, which are widely present in large molecules or organic compounds [5]. Recent studies have illustrated the potential of NIR for the identification of peanut contamination in wheat flour, milk, and cocoa powder [6], and the classification of peanuts from different cereal, legume, oilseed, and nut samples [7]. However, NIR has the limitation induced by the point measurement; thus, it cannot provide visual images of the samples to represent the spatial variations of peanut contamination proportions and identify the spatial location or position of peanut particles contaminants in a given food product. Hyperspectral imaging (HSI), which integrates spectroscopy and imaging techniques, is able to simultaneously achieve spectral and spatial information. Compared with NIR spectroscopy, the superiority of HSI exists in the visualization of prediction results, which is generated by employing multivariate analysis models to each pixel of the images. HSI allows chemical imaging for food inspection to graphically reflect the distribution of compositions or variation of proportions in the spatial dimension, which cannot be accomplished by using the naked eye or common industrial cameras [8; 9]. The HSI technique has become one of the effective rapid detection methods to predict quality attributes non-destructively, and build chemical images to display the distribution of ingredients of various food products, including monitoring the ripeness of nectarine [10], identifying the browning development of button mushrooms [11], monitoring the total volatile basic nitrogen (TVB-N) values of cured meat [12], and predicting the protein content in single wheat kernels [13]. Furthermore, some studies also demonstrated the successful application of HSI in the quantitative detection of foreign material contamination or adulteration in powdery food products, involving discrimination for milk powders from diverse plants and of different functional qualities [14], detecting melamine adulterated in milk powders [15], the detection of sorghum, oat, and corn flour adulterated in wheat flour [16], and the inspection of common cassava flour, corn flour, and wheat flour adulterated in organic Avatar wheat [17].