# THz Data Analysis and Self-Organizing Map (SOM) for the Quality Assessment of Hazelnuts
## 1 Introduction  
Hazelnuts in countries such as Italy and Turkey, the world's leading producer, play an important role in the agri-food industry due to their various nutritional properties. In order to assess the final quality of the hazelnut, several controls are implemented to monitor the main parameters, such as geographical origin, harvest time, and morphological and chemical characteristics [1; 2; 3]. One of the main defects affecting product quality and hence market value is rotten hazelnuts, which is often associated with a bitter taste. Furthermore, under certain conditions, the rotten fruit may be covered with a white patina of mold [4]. One of the most important request from the hazelnut industry is to find more efficient methods for the identification of rotten fruit, which can ruin the quality of entire batches of hazelnuts if put into production. In last few decades, there has been a great increase in requests by the agri-food industry to use technologies dedicated to food quality control. In particular, the use of diagnostic technologies, both to inspect food, but above all to improve its quality, has grown considerably. A great interest is therefore directed to those technologies that are based on electromagnetic radiation (non-invasive) for the sorting of products and the detection ofmicroorganisms, such as molds. Today, several techniques are used for food quality control. These include Raman spectroscopy [5], X-ray devices [6; 7; 8], thermal infrared [9; 10] and finally microwave-based instruments [11; 12; 13]. Of course, all these techniques have their specific features and limitations; for example, Raman spectroscopy, together with imaging techniques, is able to provide information on the chemical composition of the material, but at the same time, they are expensive methods; X-ray techniques in the food industry allow the acquisition of high-resolution images, but present risks related to the use of this radiation which, being ionizing and invasive, require special precautions to protect both the operator and the product being examined. In contrast, infrared (IR)-based technologies have the great advantage of being safe for the operator, but at the same time, they have a limited ability to penetrate matter. One example is IR spectroscopy, which has been used to check the quality of shelled hazelnuts in terms of moisture and acidity [14], defective kernels (surface mold and dark skin color) and lipid oxidation [15]. With regard to the detection of bugged hazelnuts, RGB (Red-Green-Blue) image analysis was found to be reliable for identifying damage on halved hazelnuts [16]. However, the possibility to sort the hazelnut when still intact is fundamental for the food industry. Furthermore, the RGB method, being a surface analysis, cannot detect hidden defects and therefore cannot guarantee a complete selection of the product. More recently, emerging techniques operating in the terahertz band, such as imaging and THz spectroscopy, due to their characteristics, are becoming important in this context. These techniques have been applied in various sectors, including the biomedical field [17], precision agriculture [18], food quality control [19; 20], cultural heritage [21; 22] and aerospace industry [23; 24]. Finally, techniques based on terahertz spectroscopy have been applied for the detection of hazardous mycotoxins, including aflat, in agricultural food products [25], such as almonds. However, this device is difficult to use in practice due to the numerous parameters that need to be monitored. One example is the temperature and humidity in the environment, which at these frequencies influence the THz signal. An interesting property of terahertz radiation concerns its non-ionizing, non-destructive and non-invasive nature. This allows both the operator not to be subjected to risks and the operator not to trigger chemical changes in the food. Thanks to its longer wavelength, THz radiation undergoes a lower Rayleigh scattering than infrared radiation, so it can result in a greater depth penetration.