**2. Main optical nondestructive approaches and data analysis**

#### **2.1 Vis/NIR and NIR spectroscopy**

Among the nondestructive techniques, spectroscopic analyses in the visible–near infrared (vis/NIR) and near infrared (NIR) regions are widely used in different fields. *Optimization of the Olive Production Chain through Optical Techniques and Development… DOI: http://dx.doi.org/10.5772/intechopen.102993*

Since the early 1970s, various instruments have been built that are able to exploit these technologies: instruments that acquire the sample spectrum in a specific wavelength range and record the average spectrum of a single defined area of a sample.

Vis/NIR and NIR spectroscopies are used to acquire punctual information on the nature of the functional groups present in a molecule by exploiting the interaction between light and the structure of a sample. The electromagnetic radiation is in fact able to promote vibrational transitions in the molecules. Spectra in the visible region (between 400 and 700 nm) and spectra in the near infrared region (between 700 and 2500 nm) are composed of combination and overtone bands related to absorption frequencies in the mid-infrared region (MIR, between 2500 and 50,000 nm).

All these combinations and overtone bands correspond to the frequencies of the vibrations between the bonds of the atoms that compose the molecules of the analyzed matrix. Each matrix or material is a unique seal of atoms so there are no two compounds capable of producing the same vis/NIR spectra. Through the use of chemometric statistical analyses, it is possible to use spectroscopy as an excellent tool to perform quantitative analyses. A peculiar aspect of this technique is that it does not require sample preparation, thus offering a valid alternative to traditional chemical or physical analytical methods, which instead requires time and the use of solvents or other materials. The data deriving from the spectroscopic analyses are complex and require specific statistical analyses to obtain the information of interest [5].

#### *2.1.1 Principles and instrumentation*

The chemical composition and physical characteristics of a sample determine reflection, absorption, or transmission of the electromagnetic radiation. The reflected light could cause specular reflection shine (to be avoided), while diffuse reflection is produced by rough surfaces. These reflection phenomena provide information on the sample surface. More interesting could be the scattering resulting from multiple refractions within the material. The sample heterogeneity is highly influencing the scattering effects. Also, size, shape, and microstructure of the particles have an effect on scattering.

Scattering affects the reflected spectrum, while the sample shape is more related to the absorption process. The bands of absorption in the NIR region are mainly overtones and combination bands of the fundamental absorption bands in the IR region, deriving from vibrational and/or rotational transitions. In the case of complex matrices such as foods, multiple bands and the effect of the widening of the peaks determine vis/NIR and NIR spectra with a wide coverage and few acute peaks.

To acquire a spectrum, it is necessary to use an instrument called a spectrophotometer, which consists of a light source, an accessory to present the sample, a monochromator, a detector, and optical components. Spectrophotometers are classified according to the type of monochromator: it is a device able to decompose a single polychromatic light beam into several monochromatic light beams (that contains waves of a single frequency), thus allowing to analyze the intensity as a function of wavelength.

In a filter instrument, the monochromator is a wheel holding absorption or interference filters and has a limited spectral resolution. In a scanning monochromator instrument, a grating or a prism is used to separate the individual frequencies of the radiation entering or leaving the sample so the radiation at the different wavelengths can hit the detector.

Spectrophotometers based on Fourier transform use an interferometer to generate a modulated light beam. Using the Fourier transform, the light reflected or transmitted by the sample is converted into a spectrum. The most diffused systems use the Michelson interferometer, but also polarization interferometers are employed in the optical bench of some instruments. The photodiode array (PDA) spectrophotometers have a wide diffusion; these systems are based on a fixed grating, which focuses the radiation onto a silicon array of photodiode detectors. The systems based on laser do not use monochromator but different laser sources or a tunable laser. Finally, acoustic optic tunable filter (AOTF) and liquid crystal tunable filter (LCTF) instruments are available on the market. AOTF uses a diffraction-based optical-band-pass filter easily tunable varying the frequency of an acoustic wave propagating through an anisotropic crystal medium. LCTF instruments use a filter to create interference in phase between the ordinary and extraordinary light rays passing through a liquid crystal. The combination of different tunable stages in series can result in a high resolution.

#### **2.2 Computer vision and image analysis**

One of the limitations of spectroscopic analyses is the punctual measurement and therefore the inability to provide information on the distribution of an object. Depending on the uniformity of the qualitative attribute to measure, it may be necessary to repeat the spectral acquisition in several points on the sample.

In order to get the spatial distribution, vision technique is a solution. With the huge development of imaging technology, computer vision results attracting for agri-food industry. A large number of applications have been developed for quality inspection, classification, and evaluation of agri-food products [6, 7]. Image data can reflect many external features of a sample such as color, shape, size, surface defects, or contaminations. Computer vision has been applied to solve various food engineering problems ranging from quality evaluation of foodstuffs to quality attributes unavailable to human evaluators.

Computer vision tools are powerful but not much useful for in-depth investigation of internal characteristics. This is due to the very limited capability to provide spectral information with this technique.

#### *2.2.1 Multispectral and hyperspectral images*

RGB images, represented by three overlapping monochrome images, are the simplest example of multichannel images. The multispectral images are usually acquired in three/ten spectral bands including in the range of visible, but also in the range of infrared, fairly spaced. In this way it is possible to extract a larger amount of information from the images respect to those normally obtained from the RGB image analysis. The bands that are used in this analysis are the band of blue (430–490 nm), the band of green (491–560 nm), the band of red (620–700 nm), and the band of NIR and MIR. Different spectral combinations can be used depending on the research aims. The combination of NIR-R-G (near infrared, red, green) is often used to identify green areas, for example, from satellite images. On the contrary, the combined use of NIR-R-B (near infrared, red, blue) is very useful to analyze fruit ripeness, thanks to chlorophyll absorption in the red range. Finally, the combination of NIR-MIR-blue (NIR, MIR, and blue) could be used to observe the sea and ocean depth.

Hyperspectral imaging (HSI) is a powerful tool combining spectroscopy and imaging into a three-dimensional data structure (hypercube). The HSI is based on the *Optimization of the Olive Production Chain through Optical Techniques and Development… DOI: http://dx.doi.org/10.5772/intechopen.102993*

acquisition of a large number of images at different spectral bands, allowing analysis of each pixel obtaining at the same time a spectrum associated with it. The data structure of a hyperspectral image is data cube, considering two spatial directions and one spectral dimension.

Hyperspectral technology can integrate the advantages of conventional digital imaging and spectroscopy to obtain both spatial and spectral information from an object simultaneously.

In recent years, HSI has been applied to food safety and quality detection, because the technology can achieve rapid and nondestructive detection of food, and the requirement to experimental condition is low [8].

HSI has opened up new possibilities within agri-food analysis, in particular Liu et al. [9] outlined detailed applications in various food processes including cooking, drying, chilling, freezing and storage, and salt curing, emphasizing the ability of HSI technique to detect internal and external quality parameters in different food processes [9].

Using HSI, the hypercube can be acquired in reflectance, transmission, and fluorescence. Nevertheless, the most used acquisition techniques for spectral images are reflectance, transmission, and emission, considering the scientific works published. HSI has many advantages, e.g., the huge time savings that can be obtained for the application to industrial production processes. The advantages of HSI for the agri-food sector can be listed as follows: (i) not necessary sample preparation; (ii) noninvasive methodology that avoids sample losses; (iii) economic value related to time, labor, reagents, savings, and a strong cost-saving for waste treatment; (iv) for each pixel of the sample is acquired the full spectrum and not only few wavelengths; (v) many constituents can be predicted at the same time simultaneously; (vi) special region of interest could be selected and analyzed.

The hypercube generated by using HSI provides a large dataset. The information derived from the hypercube may contain also redundant information. This data abundance may cause a high computational load due also to the long acquisition time. Therefore, it is desirable to reduce this load at acceptable levels, considering the application of HSI for real-time application. For this purpose, the spectral image is appropriately reduced using chemometric data processing, mainly selecting the most informative wavelengths. Using the selected spectral bands, a multispectral system can be envisaged for application at industrial level.

#### **2.3 Chemometrics in agri-food sector**

Chemometrics is defined as a branch of chemistry that studies the application of mathematical or statistical methods to chemical data. The International Chemometrics Society (ICS) defines it as a chemical discipline that uses mathematical and statistical methods to: design/select optimal procedures and experiments, provide maximum chemical information by analyzing data, give a graphical representation of this information, in other words, information aspects of chemistry. Chemometrics is essential for processing multivariate data obtained by optical techniques and for obtaining useful information for solving problems related to spectral noise.

One of the most used techniques is the Principal Component Analysis (PCA), also known as the Karhunen-Loève transform. It is an unsupervised exploratory qualitative analysis technique that allows reducing the more or less high number of variables describing a set of data to a smaller number of latent variables, limiting the loss of information.

Other chemometric techniques used extensively in these fields are supervised techniques, techniques that require method validation and that are used to obtain the quantitative prediction of the parameters of interest. Among these we find regression techniques such as Partial Least Square (PLS) regression or Multiple Linear Regression (MLR). The models developed using these techniques must then be tested using independent samples as validation sets to verify the accuracy and robustness of the model.
