THz Imaging for Food Inspections: A Technology Review and Future Trends

Terahertz imaging is the newest among non-invasive sensing technologies and currently huge attention is pointed towards its use in several applications. Among possible applications, food inspection represents one of the most prominent cases, due to the possible dangerous impact on human safety. Hence, significant efforts are currently addressed towards the exploitation of THz imaging as a tool to improve the effectiveness of food quality surveys. This chapter deals with the exploitation of THz imaging technology for food quality control and assessment. In particular, the chapter aims at reviewing the latest developments regarding THz imaging, both in terms of measurement systems and data processing methodolo-gies. Moreover, the chapter summarizes experiments available in literature and presents some purposely designed experiments to address the discussion on currently open issues.


Introduction
The agricultural and food (agri-food) industry has always attracted significant attention worldwide. In particular, the importance of reliable diagnostic inspection technologies has been growing due to an increasing demand for improving the quality of life. Contamination by foreign bodies, packaging failures and the production of articles with poor characteristics (consistency, appearance) are among the main sources of customer complaints against manufacturing companies, with consequent loss of brand credibility. The food industry is particularly exposed to this problem, especially nowadays that consumers are more aware and pay much more attention to the quality and integrity of the food purchased. Accordingly, huge interest is towards the use of sensing technologies capable of detecting foreign body contamination and packaging failures. Available sensing techniques for food inspection include X-ray imaging [1][2][3], thermal imaging [4,5], ultrasonic imaging [6,7], fluorescence imaging [8] and electromagnetic (EM) systems working at microwave frequencies [9][10][11][12]. However, each one of these techniques has advantages and limitations. For example, X-rays systems, which are increasingly used in the food production industry for quality control inspection, provide high resolution images but have difficulties in detecting low density objects such as plastic, glass, wood or insects. Furthermore, the use of ionizing radiation is always related to risks involving both operators and the food itself that could be altered. On the other hand, infrared (IR) technologies have the advantage of being fast and safe but they are limited by a poor penetration capability and strong absorption in water. Instead, fluorescence imaging is effective only when objects with fluorescent compounds are investigated. In this framework, terahertz (THz) imaging appears as an emerging technology, which offers several advantages. THz are electromagnetic waves ranging from 0.1 to 30 THz (wavelength from 3 mm to 10 μm), which are currently exploited in various applications, including medical diagnosis [13], pharmaceutical analysis [14], security enhancement [15] and artwork [16]. As microwaves and infrared signals, THz waves are non ionizing radiations thus they allow a safe survey without requiring specific security protocols. Moreover, similar to microwave imaging and differently from X-ray technology, THz systems allow the detection and localization of changes in terms of electromagnetic properties with a high resolution (generally speacking, THz spatial resolution is in the order of some hundred microns while the microwave spatial resolution is typically about centimiters). On the other hand, THz capability of penetrating inside a material is limited to a few millimiters. In addition, THz waves are strongly attenuated by water and suffer the environment humidity conditions. Currently, several studies regarding the detection of both food contaminants [17,18] and defects in plastic packages [19] have shown the effectiveness of THz imaging technology in the field of food industry. However, the study of THz potential in food inspection is still at an early stage and far to be completely assessed.
This chapter provides an overview of THz imaging for food inspection by summarizing the current state of the technological development and recalling valuable case studies presented in literature. For sake of completeness, the chapter starts with a brief description of the main THz technologies, i.e. THz pulsed and time domain systems as well as continuous wave ones. Then, THz imaging in transmission mode, THz Time of Flight imaging and THz Camera imaging are reviewed and their advantages and drawbacks are discussed. Thereafter, the attention is focused on the employment of THz imaging for food quality control and its potentialities in detecting contaminants and packaging failures. Relevant examples available in literature are described together with some experiments carried out by the authors themselves. Finally, the main open challenges and future perspectives are discussed.

THz imaging systems
Systems for THz imaging can be divided into two main categories based on their operative principle: pulsed and continuous wave systems.
Pulsed or time domain (TD) systems are composed of four principal components: primary source, which is an ultrafast pulsed laser emitting sub 100 fs pulses, THz emitter, THz detector and a time delay stage.
There are two major technologies to generate and detect THz pulses: photoconductive antennas (PCAs) and electro-optic crystal (EOC); usually one emitter and one detector are used, even if technologies based on the use of detectors arrays are available [20]. The ultrafast laser beam is divided into pump and probe beams (Figure 1). THz pulse is generated by the pump beam that affects the emitter, while the probe beam is used to gate the detector. The probing THz wave is focused onto the sample using polymeric lenses or mirrors. After the interaction with the sample, the THz wave is collimated and refocused on the terahertz detector. The delay stage is used to offset the pump and probe beams and allows the temporal sampling of the THz signal.
CW or frequency domain systems are based on the beating of two laser wavelengths, whose difference is in the THz region, in a biased semiconductor photomixer [21]. If the photomixer is connected to a properly designed antenna, THz radiation is emitted into the free space. The CW THz radiation is then collimated and guided in the same manner as for pulsed systems [21]. TD and CW THz systems have many differences. TD systems are more complex, expensive and heavy than CW ones but they work in a wide band, usually from 0.1 up to 6 THz for the new generation systems [22]. Moreover, they gather the signal as a function of the time and, thus, allow to reconstruct more information about the investigated samples, provided sophisticated data processing procedures are adopted. Conversely, CW systems are narrow-band and often gather only the intensity of the detected signals, which is stored in a matrix and directly converted to a raster image. Therefore, they are effective in generating THz images almost in real-time but also make inaccessible some information and thus are less flexible. It is worth remarking that TD systems encode depth information as changes in pulse timing, i.e. a variation of the temporal location of the measured peak that indicates a change in the optical path length from the emitter to the sample and from this latter to the detector. CW systems also make possible to obtain this information through the use of additional detectors or by performing additional scans. For instance, by changing the angle between emitter and detector, it is possible to measure the scattered wave instead of the specular reflection. Hence, by performing measurements at different angles it is possible to record intensity data accounting for scattering and reflection  phenomenon occurring at different depths and, thus, to image features of each layer of the measured sample [23].
The choice between TD or CW systems depends on the application of interest. Focusing on food inspections, a preferable choice is a TD system, when the goal is the non-destructive inspection devoted to detect defects or foreign bodies, because it provides more complete information and make possible a 3D visualization of the investigated sample. However, a CW system is sufficient when a 2D image is enough to satisfy the survey finality, as it happens, e.g., when the control of packaging is considered.
Finally, it is worth recalling that both TD and CW systems can be used in reflection or transmission mode as sketched in Figure 2a and b, respectively.

THz imaging in transmission mode
When working in transmission mode, the THz radiation propagates through the material to be inspected from the emitter to the detector. Hence, in this type of setup one places an object at the focus of the THz beam on an x-y moving stage, and measures the waveform passing through the material [24]. By translating the object and measuring the transmitted THz waveform at each position of the object, a pixel by pixel image is built. The transmitted signal is collected as a time-dependent function that contains information regarding the phase and amplitude of the THz field. The recorded signal is digitized and processed by the digital signal processor (DSP) at each pixel to obtain the transmission THz image of a sample [25]. Specifically, several 2D THz images are obtained by plotting, point by point, different features of the measured wave-forms, i.e. their amplitude, phase, maximum or minimum values and so on [26]. Moreover, by means of the Fast Fourier Transform (FFT), frequency-domain information on the samples are also obtained [27]. The transmission mode is effective because many materials strongly absorb THz radiation, while others are transparent. Hence, it is possible to obtain information on the sample by plotting the amplitude of the measured wave-forms and observing its spatial distribution, while taking into account that higher amplitude values correspond to THz transparent materials. However, if the sample is too thick no useful image can be obtained. Further information is obtained by computing the absorption coefficient and refractive index by using the sample E s ν ð Þ and the reference E r ν ð Þ spectra. In transmission mode, E r ν ð Þ is calculated by taking measurements without the sample. Specifically, the transmission function is defined as follows [28,29]: where d is the sample thickness, ν is the radiation frequency, c is the speed of light in vacuum, n is the refractive index, α is the absorption coefficient, A is the amplitude ratio between the sample and reference spectra and ϕ is the relative phase difference. Hence, it is possible to calculate n and α for each frequency as: By taking into account that some materials exhibit strong absorption peaks at specific THz frequencies, once the absorption coefficient and the refractive index have been computed, it is possible to collect information on the structure of the sample and on its materials. THz transmission imaging provides a wealth of information by analyzing the 2D images of these indices at different frequencies, but the pixel by pixel scanning procedure is time consuming and often suffers from poor spatial resolution because the spatial offset used to move mechanically the sample is often comparable or larger than the wavelength of the THz radiation [30].

THz time of flight imaging (TOF)
THz time-of-flight imaging (TOF) also known as THz pulsed imaging (TPI) has the unique property of providing a 3D "map" of the object by exploiting data collected in reflection mode [31]. This technique was used for the first time by Mittleman and coworkers to produce the internal structure of a 3.5 inch floppy disk [24]. The apparatus used for reflection imaging is quite similar to the transmission one, except for the change regarding the THz beam path (see Figure 2) [32]. In brief, the object is probed by a pulse signal and the reflected waveform is collected as a time-dependent function in a certain observation time window using a THz-TDS configuration. The temporal delay of the reflected pulses reveals the internal structure of the sample (if the object is nonmetallic). By collecting data along a line, moving emitter and receiver along a straight trajectory and plotting the gathered wave-forms, a space-time image is obtained. In particular, the data can be represented in the form of a THz radargram (see Figures 7 and 8 in Section 4.1), that is a two-dimensional image, wherein the horizontal axis is the spatial coordinate and represents the measurement line, while the vertical axis is the temporal coordinate and represents the time of flight, that is, the time T that the waveform employs to propagate from the emitter to an electromagnetic discontinuity and to go back to the receiver (see Figure 3). The time of flight T is related to the distance d between THz probes and the detected discontinuities as: v being the electromagnetic wave propagation velocity into the object. Therefore, a THz radargram provides a cross-sectional representation of the inner features of the object, which gives information about position and thickness of possible inner discontinuities. A 3D characterization is obtained by collecting radargrams along parallel profiles and visualizing the stored data all together.
Reflection mode is effective because different materials exhibit different behavior when illuminated by THz radiation. In principle, as in transmission mode, the spatial distribution of the refractive index can be retrieved, since amplitude and phase of the reflected signals are available by means of the Fourier transform, even if it is quite complex to define the reference signal and this makes the calculation of the reflectivity more complex. On the other hand, it is important to take into account that the reflectivity of an object depends not only on its refractive index, but also on the surface roughness, polarization of incident THz radiation and other geometric factors [15]. In addition, noise is a crucial problem in this case and advanced filtering and signal processing approaches are required. In fact, the intensity of the signal measured in reflection mode is generally lower than in transmission mode. In this respect, noise filtering and deconvolution procedures are commonly applied to improve the final image quality [33].

THz camera imaging system
An important research topic regards the development of THz cameras similar to the optical ones. Although active and passive THz cameras have been proposed, THz cameras are mainly designed as an active sensor, being the natural emission of THz wavelength extremely weak. Therefore, an appropriate source has to be used to illuminate the scene. Two main types of THz cameras are available in literature: thermal cameras and FET cameras [34]; they are briefly described in the following.
Thermal cameras record an image based on the heat generated by the THz radiation and exploit three types of thermal detectors: Golay cell, Pyroelectric sensors and bolometers. Golay cells transfer the generated heat to an expanding gas cell and measure the increased pressure optically by means of moving mirrors [35]. Being based on the mechanical movement of a membrane, Golay cells are slow detectors and are difficult to be integrated into dense arrays of detectors. Consequently, THz imaging with Golay cells is often done in a single-pixel detection scheme. Pyroelectric sensors detect changes in terms of the electrical polarizability of certain crystals, which is generated by a temperature growth [36]. Unlike Golay cells, pyroelectric cameras based on an array of detectors are commercially available but are characterized by a low sensitivity and this issue makes them less effective for THz imaging. Bolometers detect the change in a temperature-dependent resistance and are often based on the well-known infrared imaging technology adapted to THz frequencies [37]. Currently, microbolometers (i.e arrays of bolometers mounted onto read-out integrated circuits fabricated with CMOS process technology) are specifically designed to operate at THz frequencies and make possible to reach a sensitivity level suitable for industrial imaging applications, thanks to the inclusion of a Fabry-Perot cavity, antennas, and metamaterials to increase the absorbed THz radiation [38].
THz FET-based cameras measure a rectified voltage after interaction of the THz radiation with a plasma wave in a transistor channel [39]. This approach based on antenna-coupled FETs for THz detection have been implemented in standard CMOS technology [40]. Their production does not require different procedures with respect to standard CMOS technology, which provides the benefit of high maturity in terms of fabrication yield and pixel uniformity. On the other hand, to perform a successful THz imaging, the source beams must be expanded and in several standard setup [41] such an expansion is realized by means of parabolic mirrors without any absorption.
Generally specking, the operating principle of a THz camera does not differ so much from that described in the previous paragraphs: a source illuminates the object under test and the reflected (or transmitted) signal is collected by the camera. Moreover, between the object under test and the camera there are often lenses devoted to focus the THz beam on the camera. The main difference with the THz imaging system described in 3.1 and 3.2 is that the THz cameras provide nondiscriminatory intensity-based imaging. It is worth pointing out that, at the current state of the technological development, THz cameras appear suitable to a possible industrial application even if there are still issues related to the requirements to be satisfied. First, the cameras manufacturing process should be compatible with existing manufacturing techniques, such as CMOS technology, which enables the development of high resolution image arrays, in order to reduce the costs. THz cameras must be able to operate at room temperature while still retaining high sensitivity and should be characterized by contained size, weight and energy consumption in order to facilitate integration into industrial imaging systems. Furthermore, it is crucial to assure that data acquisition and processing time are compliant with the time of a production line [42,43].

Applications of THz imaging in food industry
This paragraph provides an overview of the potentialities offered by THz imaging in the frame of food inspections by presenting examples available in literature as well as experiments carried out by the authors themselves. Specifically, two kind of inspections are considered: 1) the detection of defect and foreign bodies; 2) the packaging quality control.
It is worth pointing out that non-polar and non-metallic substances, such as plastic, cardboard, wood and other common packaging materials, are transparent to THz radiation and show very weak interaction with THz waves. This makes THz imaging attractive tools for the inspections of packaged products. Consequently, the use of THz waves allows us to detect unwanted objects that compromise the safety of the product as well as to check defects of the sample under test by controlling its integrity. In this way, defects such as irregular shape, breaking and even absence of the product itself inside the package can be detected.

Defect and foreign body detection
The presence of defects and foreign bodies in food is one of the major concerns of the food industry. Usually, the term 'foreign body' refers to unwanted objects in food products and it accounts for contaminants originated both by food products themselves (e.g bone in meat; fruit stones) and by manufacturing or packaging processes (e.g metal, plastic, glass pieces and small stones) as well as for warms and insects. In the last years, several research groups have focused their activities on THz surveys devoted to detect and localize undesired hidden objects and to verify the quality of food products. For this purpose, both CW systems and pulsed ones have been employed.
The employment of THz systems for the detection of contaminants such as small stones, glass, plastic and metal has been considered to investigate flour [44], milk powder [45], wheat grain [46] and chocolate bars [47]. It is worth reporting, as an example, the THz inspection of chocolate bars [17], that represents a promising field of THz imaging application. In [17], THz imaging was performed in transmission mode with the aim of detecting contaminants such as stones, glass and metal screws in chocolate bars and a THz-TDS working in the frequency range from 50 GHz to 2.5 THz was used. The 2D images were obtained by scanning the samples perpendicularly to the THz beam. In all the analyzed cases, contaminants were clearly localized in THz images due to the lower intensity of the transmitted THz radiation when the foreign body were present. In fact, glass and stone absorbed part of the signal decreasing its intensity, while metal reflected all THz radiation. THz transmission imaging allowed to identify foreign bodies in the chocolate sample both in the presence and absence of the plastic foil packaging. In [17], it has been also demonstrated that is sufficient to record only some key points of the THz waveform in order to collect all the necessary information thus decreasing the amount of data and the measurement time and bringing the scanning speeds to 0.55 m=s. Furthermore, THz technology has been exploited to detect undesired hidden insects such us crickets, mealworms and grasshoppers in flour [48], milk powdered [18], noodle [49][50][51] and chocolate bars [47]. These studies have been referred to laboratory prepared contaminated samples and have provided a preliminary assessment of THz capabilities to detect insects in food.
The possibility to check the quality of red ginseng and walnuts has been investigated in [52], where a sub wavelength transmission imaging system based on Bessel-Gauss beam focusing in the 140 GHz frequency band has been used. Information about the quality of the analyzed product was obtained since THz images showed that high quality samples have a relatively uniform internal structure. It has been demonstrated that red ginseng and walnuts with thicknesses of 20-30 mm could be inspected without causing damage and the internal structure of these objects was observed non destructively. Finally, already commercially available THz imaging system [53], has been used to check the presence (or the absence) of chocolate bars inside their package, preventing any complaints due to an incorrect number of bars.
In this context, the potentialities offered by THz imaging has been assessed by the authors themselves and two test cases involving chocolate cream are herein presented. The results have been obtained by means of the Zomega THz FiCo system available at the Institute for Electromagnetic Sensing of the Environment -National Research Council of Italy (IREA-CNR). The adopted THz system is equipped with an ad hoc designed imaging module, which allows an automatic planar scan (see Figure 4) and collects data in normal reflection mode in the effective frequency range from 40 GHz to 1.16 THz. For a more precise description of the system see [16,54]. The collected data have been processed by means of a two-step filtering procedure: a band pass filter designed to select the effective spectrum of the signal [54] followed by a singular value decomposition (SVD) procedure [16]. Figure 5 shows the chocolate laboratory-prepared samples that are made by a plastic support filled with a chocolate cream: in the first case there is a surface defect consisting of a piece of pistachio peel (see 5a), in the second case metal has hidden 1 mm deep inside the chocolate cream, mimicking the foreign body (see 5b). Falsecolor THz images are shown in Figure 6, and have been obtained by plotting, point by point, the maximum amplitude of the processed data collected by the system. Figure 6 demostrates the THz imaging ability to detect pistachio peel on the surface of the chocolate cream (see 6a) and the presence of the metal inside the sample (see 6b). Figure 7 shows filtered data, referred to the sample in Figure 5a, that have been represented in the form of a THz radargram as described in Sec 3.2. The data have been gathered with a 0.25 mm spatial step along the x-axis, for y = 14 mm and y = 20 mm, which correspond to lines where the surface defect is present and absent, respectively. By observing 7a, it is possible to note that the extent of the   defect ranges from 10 mm to 22 mm. Figure 8 shows THz radargram, referred to the sample in Figure 5b, gathered with a 0.25 mm spatial step along the x-axis, for y = 20 mm, that corresponds to an area where the contaminant is present. By observing Figure 8, it is possible to distinguish two reflections due to occurrence of different materials. In particular, the first reflection is related to the air-chocolate interface, while the second reflection represents the interface between the chocolate and the metal layer. Based on the obtained results, one can state that THz waves allow us not only to image the surface defect on the food samples, but also to detect and localize hidden objects that may be dangerous for human life.

Packaging quality control
The detection of production defects in plastic or paper packaging is a potential area of application for THz imaging. The possibility to check the integrity of plastic welded joints using THz waves has been explored in [55] where a THz -TDS system in transmission mode with a frequency range from 50 GHz to 2.5 THz has been used. Several sheets of high-density polyethylene welded into a lap joint with  different welds imperfections have been studied. The results obtained showed that the contamination of metal or sand within the weld joint of two plastic sheets could be clearly identified. Furthermore, THz-TDS allowed to distinguish between welded and non-welded material.
Analysis regarding paper packaging defects have been carried out by the authors of this chapter using THz FiCo system introduced in Section 4.1. The experiments have regarded non destructive testing of sugar bags with and without packaging defects. A standard packaging is reported in Figure 9a, while the sachet of sugar in Figure 9b is characterized by a surface defect of about 10 mm. The data has been gathered with a 0.4 mm spatial resolution along the x and y axes. Figure 10 indicates the ability of THz imaging to represent accurately the surface of the packaging. In particular, the defect of the package has been successfully checked guaranteeing an effective control of quality as Figure 10b shows. These results allow us to appreciate the diagnostic capabilities of THz technology of detecting packaging defect that could compromise the quality of the food.

Challenges and perspectives
THz imaging has interesting features that make it particularly attractive for food quality control. However, there are several issues to be faced in order to move from  laboratories and academic environments to a widespread industrial use. In this frame, main issues are: 1. cost of detectors and sources, that is still too high to make THz technology economically convenient for many applications; 2. scanning time, which is not compliant with the time of an industrial production line; 3. high sensitivity to the environmental parameters, which implies a Signal to Noise ratio not suitable for an accurate imaging.
Thanks to technological advancements regarding the development of laser sources, integrated optics and industrial-grade THz hardware, a significant cost reduction has been registered in the last years and it is expected in the future, thus the availability of low-cost and high performance THz imaging systems appears as a reachable goal. Furthermore, high performance multipixel THz cameras look like a valuable solution to perform an accurate real time imaging satisfying someone of the most relevant inspection requests. In this regard, the use of 2D arrays of emitters and detectors is worth to be considered in order to avoid mechanical movement of the sample. Alternatively, single-pixel detection combined with compressive sensing techniques can be employed [56]. There are also challenges related to attenuation, penetration depth and scattering effect of THz radiation to be considered. THz waves suffer a strong absorption by water and appears not effective to inspect high humidity products with a thickness greater than 1 mm. In this respect, broadband systems or systems working in the low-frequency THz region are subject of research activities [57]. On the other hand, it is important to study THz interaction with food materials and how it depends on the water type and its level. On the other hand, THz waves exhibit a low penetration depth especially when measuring high-moisture foods (e.g meat; fruit). The penetration depth depends on several factors such as properties of the food material, thickness of the sample, power of THz source, probing wavelength, view and observation angles under which the food is surveyed [58]. Modern THz systems mitigate this problem enhancing the power of the THz radiation [59]. The scattering effect affects both transmission and reflection THz imaging and it is ascribable to in-homogeneity of food, the presence of particles having irregular shape and size comparable to the probing wavelength [25]. This challenges can be faced by using data processing algorithms exploiting an advanced modeling of the interaction between THz radiation and food [25].
Finally, it is worth pointing out that, due to the diversity of samples to be analyzed, most of the high-speed THz systems are application-specific. In fact, in order to improve the performances of THz system in a manufacturing and processing line, the system must be specifically optimized for that particular product and purpose. This process is usually long and labor-intensive.

Conclusions and future trends
We presented an overview of the instruments and sensing principles used for THz imaging and its application for food quality inspection. This chapter has begun by presenting the main adopted THz systems and imaging modalities. In particular, we focus our attention on THz imaging in trasmission mode, THz Time of Flight imaging and THz Camera. Then, examples have been summarized briefly in order to show THz imaging applications to different food samples. It emerged that, THz waves are characterized by the ability to pass through a wide variety of packaging materials allowing us to control the quality of the products packaged in glass, plastic, paper and cardboard. On the other hand, THz waves are able to detect low density material hidden in food products through a non-destructive monitoring. Although the effectiveness of THz imaging has been demonstrated for a large number of issues in food quality control, it is clear that there is still a long way to go before this technology can be applied in industrial processes. In fact, the costs of THz instrumentation are still very high, there are limits in the penetration depth that can be investigated and the process is time consuming. So future research is needed to develop fast and economical THz systems through the implementation of compact and more efficient instrumentation. Another important goal to be achieved is the introduction of a database library for the main food component that can simplify the prediction and detection processes. Despite the limitations, THz imaging is establishing itself as a powerful tool for non-destructive inspection in the food industry and for the next future its use is expected to be considered in a wide range of surveys and become more and more consolidated.