Keywords

1 Introduction

The food industry involves complex interrelated processes that must be monitored and controlled to ensure consistent high quality and undisputable safety of the product being manufactured. Traditionally, most of the quality and safety parameters are monitored off-line, which are time-consuming, require skilled labour, involve several intermediary steps and are subjected to misinterpretation. With the industry 4.0 and smart manufacturing movement, the food industry today has huge opportunities to upgrade its processes to align itself to the latest industrial revolution (Udugama et al. 2020; Yadav et al. 2022). This implies that with advancement in technology, the food industry could adopt “in-line” and “on-line” systems to monitor the performance of its processes, rapidly identify defects or faults if any, check for quality and ensure safety of the product, practically “real-time” (Gargalo et al. 2020). This also assumes importance in the background of increasing need and demand of consumers for safe, hygienic, properly labelled food as well as stricter laws and regulatory requirements for safe and high-quality product (Hassoun et al. 2020).

The technical definitions of these monitoring and control systems adopted by the industry in food quality and safety is described below (Claβen et al. 2017):

  • “In-line” refers to a measurement that is made using a device or sensor which measures from the process line without sample removal or diversion. Measurements are made on a continuous basis “real-time”.

  • “On-line” refers to measurement where a sample from the process line is diverted by a bypass, immediately followed by its analysis. Measurements are made on a continuous basis “real-time”.

  • “At-line” refers to usage of a device near the process line which separates the material from the sampling point, followed by its conditioning such as filtration, separation, addition of reagents etc., and then analysis. Measurements are not made on a continuous basis and data generated depends on the frequency of analysis over pre-determined time intervals.

  • “Off-line” refers to analysis of sample that is withdrawn from the process line and is analysed in a laboratory or centralized facility.

Figure 12.1 is a schematic diagram of monitoring systems used in process analysis. It may be noted; since the difference between “on-line” and “in-line” sensors is very narrow, the terms have often been used interchangeably in literature. In the chapter, we have included “in-line” as those technologies which have sensor probes, device or instrument that is integrated with the process operation as part of the process flow, with or without conditioning, in a continuous manner, without sample preparation (unlike atline or offline) and which give results of parameters without the requirement to stop or discontinue the process. Emphasis is therefore on non-invasive or non-destructive and rapid techniques that give the results “real time”.

Fig. 12.1
4 diagrams of monitoring systems in 4 modes. 1. In In-line mode, the sensor measures from the process line. 2. In on-line, the sensor measures from the process line diverted by a bypass. 3. In at-line, the sensor measures near the process line. 4. In off-line mode, sample is not in process line.

Various modes of process analysis (Adapted from Gargalo et al. 2020)

By convention, the most common sensors used in the industry for the purpose of process monitoring include those that measure physical parameters such as the temperature, pressure, level and flow sensors (flowmeters) (Patel and Doddamani 2019). In this chapter, our focus would be on sensors and devices which are used to monitor physical, chemical and biological parameters of food products in terms of their quality and safety rather than on physical and mechanical process parameters such as pressure, temperature, etc. Table 12.1 illustrates the different parameters that can be measured in an industrial set up as inline operations. These parameters are some examples and in no way exhaustive and there are many others which are being applied/explored for measurement by the food industry.

Table 12.1 Possible parameters that can be measured “inline” for food quality and safety determination

1.1 Pre-requisites and Desirable Quality of In-Line Sensors

1.1.1 Requisites

  • Suitable design for easy process integration

  • Rapid and accurate measurement in real-time with fast data processing and analysis

  • No requirement of sample preparation

  • Automatic data acquisition capability

  • Robust with ability to collect proper representative, reliable and reproducible data amidst challenging industrial environments such as temperature fluctuations, sample movement, sample inhomogeneity, presentation etc.

  • Compact, with minimum requirement of space

  • Ability to withstand harsh process environment, such as high or low temperatures, vibrations, dust, humidity, etc.

  • Easy to maintain with features such as explosion-proof, waterproof, easy to clean etc.

  • Should not cause any disruption to the production process.

  • Sensors having any contact with food material must be food-safe, inert and not affected by any chemical or physical changes in the process

1.1.2 Desirable

  • Enabled by remote control via fibre-optic probes or ethernet

  • User friendly with no requirement of trained or skilled personnel during operation

  • Cost effective with requirement of minimum or low investment by the industry

  • Easily adaptable to harsh industrial set up

2 Role of In-Line Sensors for Monitoring Quality and Safety in Food Industry

Food samples need to be measured for their physical, chemical and nutritive aspects to produce quality and safe product in order to meet consumer satisfaction and also regulatory requirements. Any food product may have limited shelf life or low quality due to a number of factors including poor quality of raw material, low or poor process control, incorrect method of packing, transportation, handling, time-limited supply chains, type and method of storage, etc., (Alander et al. 2013). An early, easy and rapid analysis of products at different stages of its production is extremely desirable (and in many cases necessary) to ensure freshness, higher yield, safety, consistency etc., which ultimately dictates economic profit for an industry. Elimination of low-quality material, defective items, un-conforming products, contaminated products, possible hazardous operations, etc., at early stages, particularly with non-invasive techniques which do not require to disrupt the process, do not require sample preparation and yet have the ability to give fast and accurate results, have shown to add tremendous value to the food industry (Dietzsch et al. 2013). In this context, spectroscopic techniques are the most suitable for such “inline” monitoring and measurement. This chapter thus, focuses on spectroscopic techniques for inline monitoring and control of food operations in the industry.

3 Spectroscopy Based In-Line Sensors and Monitoring Systems

The most common and promising in-line sensors or devices for monitoring food processes is based on spectroscopy. The biggest advantage of using spectroscopic techniques is that, several chemical, physical, and biological species of interest, relevant to quality and safety of a product/process can be measured over a wide range of electromagnetic spectrum of light which ranges from near infra-red, mid-infra-red, visible and UV range, to low frequency radio waves and high frequency γ-rays (Abu-Absi et al. 2014). For any process, the characteristic emission and/or absorption spectra are observed for the sample or selected molecule or compounds in the sample, providing valuable and required information on the quality or safety parameter being analysed. Spectroscopy based techniques can be non-invasive, extremely rapid, reliable and non-laborious. It is precisely due to this reason, that several food industries have adopted spectroscopic analysis of their processes and products to monitor as well as control food quality and safety. This technique will continue to be the method of choice for PAT initiative for Industry 4.0 (Eifert et al. 2020). Advancement in instrumentation, computation and data analysis through machine learning has made spectroscopic techniques, the method of choice for inline monitoring of industrial processes.

Spectroscopic techniques are based on the interaction between matter and electromagnetic radiation. Atoms contain electrons that exist at discrete energy levels which correspond to their resonant vibrational frequencies. Electrons can absorb radiation get excited to higher energy state and emit energy as they come back to their ground state. The major spectroscopic techniques used in inline sensors include those that are based on reflectance, transmittance and interactance (Fig. 12.2). These modes depend on the position of the illumination source and the detector. When the illumination source and the detector are above the sample, and light reflected from the sample is captured, it is referred to as reflectance or diffused reflectance, when light source and detector are placed opposite to each other, the light that is transmitted through the sample is captured, the mode is called transmittance, when the illumination source and the detector are placed parallel to each other, it is referred as interactance (Hassoun et al. 2020).

Fig. 12.2
4 diagrams with a block filled with a sample. 1. Light falls on the sample and is transmitted to the detector. 2. Light falls in the sample and is reflected to the detector. 3. Light falls on the sample and is transflected to 2 detectors. 4. 2 light beams fall on the source and interact.

The different modes of spectroscopic analysis based on position of illumination source and detector. (Adapted from Kang 2011)

All spectroscopic techniques follow the basic steps described below:

  1. (a)

    Optimization of measurement conditions based on the complexity of the process, type of components being analysed, nature of sample matrix, suitability of type of technology and the instrument that needs to be used.

  2. (b)

    Appropriate and accurate calibrations between the analyte of interest and the spectra collected from the system followed by generation and selection of an appropriate dataset that will effectively capture the variations and complexity of the system.

  3. (c)

    Application of multivariate chemometric methods to develop models, transforming the measured spectra into useful information.

  4. (d)

    Validation of the developed models with conventional techniques to ensure reliable and repeatable measurement of the samples.

In the following sections of the chapter, we discuss the principles of four spectroscopic techniques which have been more widely used in the food industry for the evaluation of processes or products for process monitoring and control. They are: (a) Infrared Spectroscopy: which include near infra-red (NIRS) and mid-infra-red spectroscopy (MIRS) (b) Fluorescence Spectroscopy (FS) (c) Raman spectroscopy (RS) and (d) Dielectric spectroscopy (DS). Spectroscopic methods can provide both qualitative and quantitative identification of a chemical or biological species, since the wavelengths of the absorbed and/or emitted radiation are chemical specific while the intensity of the radiation depends on the concentration of the species. Figure 12.3 gives the flow diagram for the common vibrational techniques used for sample analysis.

Fig. 12.3
A flow diagram for sample analysis. Sample food undergoes inline, online, at-line, and offline modes of analysis, followed by a line graph of absorption versus wavelength, chemometrics, A I M L tools, classification and quantification, and results.

Flowsheet for analysis of quality and safety of food matrix using IR- based tools in supply chain

The following section discusses, in brief, the principles of spectroscopic techniques used in inline sensors.

3.1 Infrared Spectroscopy

3.1.1 Near-Infrared Spectroscopy (NIRS)

Near infra-red spectroscopy (NIRS) is the most applied technique and has been extensively used in the food industry at various stages of food processing. It has been used in pre-harvest steps (for example, to evaluate quality of raw produce) to post-harvest assessment of final processed product. The greatest advantage of NIR spectroscopy in inline industrial applications is their ability to provide non-invasive, rapid, and accurate results with no sample preparation, ease of instrumentation as well as multiple parameter measurement in a single scan.

NIRS is based on the absorption of electromagnetic radiation at wavelengths in the range 780–2500 nm. During food analysis, the vibrational transitions characterized by low energy values are reflected in the NIR region of the light spectrum (Herold et al. 2009). In NIRS, the determination of molecules or any chemical species in food is based on the chemical bonds of the organic constituents present in it. The most common bonds include C-H, N-H, O-H, and S-H. When light falls on the sample, electromagnetic waves are transmitted, and wave behaviour changes due to stretching and bending vibrations of the bonds. These observed changes are captured by spectroscopy to provide characteristic and detailed fingerprints of the samples (Huang et al. 2014).

The general procedure to develop a NIR based analysis of target of interest involves the following steps (Wang 2019)

  1. (a)

    NIR spectra of samples is acquired and their chemical profile along with variances is analysed

  2. (b)

    This is followed by chemical composition analysis using a standard detection method

  3. (c)

    A prediction model is constructed, and unknown samples are analysed using chemometrics.

The NIR spectral data is represented as “reflection”, “transflection”, “transmission” or “interaction” (Huang et al. 2008). The most common measurement modes used in inline applications based on NIR are diffuse transmittance and diffuse reflectance. It is imperative that NIR spectra acquisition must be followed with data pre-processing or treatment because the spectral data is usually characterized by several overlaps and strong collinearity making interpretation difficult and resulting in high noise levels and baseline drifts when food samples are analyzed (Wang and Paliwal 2007). Spectral variations may also arise from light scattering in samples, temperature fluctuations, difference in particle size, density etc., which may be frequently encountered in industrial settings. Pre-treatment methods are applied in order to cause noise reduction, enhance resolution, introduce baseline correction, data centring, normalization etc. (Porep et al. 2015). Multiplicative scatter correction (MSC) and standard variate correction (SVC) are one of the most common NIR pre-processing treatments used to correct spectral data. The data acquired thus, is then subjected to statistical and mathematical analysis which is referred to as chemometrics. This may involve non-linear techniques or linear techniques which are applied to analytical information from the spectra (Herold et al. 2009). Chemometrics will be dealt in detail in the later part of the chapter. After chemometrics, calibration models are then developed using sample sets with known concentrations of target obtained with reference methods and then validating the model with sample sets other than the calibration set. It is noteworthy that NIR spectroscopy integrated as an “in line” system can provide not only a fingerprint of the chemical composition but can also generate information on physical properties of the sample under investigation, which is generally not possible with several other techniques.

A typical NIR spectrometer consists of a radiation source, a monochromator, a photoelectric detector for the measurement of the intensity of detected light and conversion into electrical signals, and a computer integrated system for spectral data acquisition and processing (Herold et al. 2009). Figure 12.4 depicts the schematics of NIR spectrometer.

Fig. 12.4
A diagram of N I R Spectrometer. It consists of a light source followed by a beam splitter, reflector, diffuse reflection detector, sample, and transmission detector. The data from the detector goes to the computer which gives the results.

Schematic of NIR Spectrometer (Adapted from Wang 2019)

The earliest demonstration of NIR for practical application in inline measurement of various parameters relevant to agriculture and food products was done by Karl Norris in several of his works (William and Norris 2001). Over the years, it has been used in the non-destructive determination of many quality and safety parameters in several food types that include dairy, fruits and vegetables, fish and fish products, meat and products, oils, honey, cereal and cereal products, grains, seeds etc. Readers may refer to reviews by Lu et al. (2017) and Wang X. (2019) which give a comprehensive account of applications of NIR in food applications. Table 12.2 details some examples of use of NIR in food analysis for quality and safety assessment. Plate 12.1 below is an image of online NIR technology to measure addition of seasoning as the sample is moved across the conveyor belt. The process integrated device can also measure fat and moisture simultaneously.

Table 12.2 NIR spectroscopy-based application for monitoring quality and safety of food products
Plate 12.1
A photograph of an In-line N I R instrument in a snack factory. The instrument scans the chips in a large container. Light from the device falls on the chips.

In-line NIR instrument based on diode array technology for continuous measurement of seasoning addition, moisture and fat content in snack foods; Photograph courtesy; Perkin Elmer. (https://www.perkinelmer.com/uk/libraries/app_measuring_seasoning_addition_in_snackfoods_da7440)

3.1.2 Mid-Infra-Red Spectroscopy

MIR spectroscopy is also an IR based vibrational spectroscopic technique that uses a beam of light through the sample and measures transmission and absorption of the light in the mid-infra-red region (2.5 to 25 μm). Transmission, transflection, and attenuated total reflectance (ATR) are the three main sampling methods of MIR spectroscopy. Like NIR, MIR spectroscopy recognizes organic and inorganic chemicals based on their unique absorption frequencies characteristic of their structure. Each chemical bond of a molecule has a unique vibrational energy, which indicates that each compound has a unique fingerprint which can be used to determine its structure.

The MIR technique has been successfully applied to assess the quality and the safety of food products such as adulteration of meat (Alamprese et al. 2013), protein content and protein genetic variants in milk (Bonfatti et al. 2016), sugar analysis of fruits and vegetables (Clark et al., 2018), gelatinization in cereals, adulteration of oil (Upadhyay et al. 2018), etc. However, NIRS still continues to be the preferred technique in the industry in spite of high sensitivity and chemical specificity of MIRS. This is because of the high cost of spectrophotometers and in several cases requirement of additional factors like liquid nitrogen for detector cooling or requirement of nitrogen gas atmosphere during measurements.

Readers may refer to Su and Sun (2019) to get a comprehensive review of application of MIR in liquid foods. In recent times, Fourier Transform spectroscopy (FT-MIR) and attenuated transmission reflection spectroscopy (ATR-MIR) have emerged as a promising tool in “inline” monitoring systems for the industry. They are discussed in brief below:

3.1.3 Fourier Transform Infra-Red Spectroscopy (FTIR)

There are two types of IR instruments that find application in sensing, they are: dispersive and Fourier transform (FT).

FT-IR uses an interferometer to measure all the frequencies simultaneously. The interferogram is then subjected to Fourier-transformation (a mathematical expression) where data is transformed into a spectrum. FT-IR spectroscopy is generally integrated with MIR than NIR because it works best at longer wavelengths and the chemical information derived is more specific (Abu-Absi et al. 2014). FT-IR instruments have several distinct advantages over the dispersive type such as higher throughput and accuracy. FT instruments enhance sensitivity, permit higher energy throughput, and dramatically increase the speed of spectral acquisition (Su and Sun 2019).

3.1.4 Attenuated Transmission Reflection Spectroscopy

Attenuated transmission reflectance or (ATR) works on the principle of measuring the changes that occur in a totally internally reflected infra-red beam when it comes in contact with the sample. The beam is directed to an optical crystal which has a high refractive index and is in contact with the sample. The internal reflectance creates an evanescent wave which is altered or attenuated in the regions of the IR spectrum where the sample absorbs energy. ATRS which is also generally in the MIR region, successfully overcomes the limitations of sample preparation and spectral reproducibility which are commonly encountered problems in spectroscopy.

3.1.5 Limitations of IRS

The main limitation attributed to the use of IR spectroscopy is its inability to analyse chemicals present in trace levels in samples because of the weak absorption by the target in comparison to other constituents. It is generally accepted, that it can be used to detect only those samples whose counts are more than 0.1% mass ratio. The other challenge of IRS is; the sample data is greatly influenced by other chemical constituents in the sample. IRS is also heavily dependent on statistical and mathematical tools specially to analyse variance in the chemical profile. It is generally also considered to be less precise without a sample separation process (Wang 2019). The use of IRS is also limited because of variations that arise in data as a result of the complexity of the samples in question, for example, varietal differences of plant based raw material, variations arising due to movement of samples hindering precise capture of spectra, environmental variations affecting the sample etc. Moreover, not all constituents in food are IR active and so cannot be detected. Since most food commodities contain water, the influence of water on the IR spectra is of major concern.

However, in spite of the disadvantages, IR spectroscopy continues to be the most popular technique for inline sensing.

3.2 Dielectric Spectroscopy

Dielectric spectroscopy (DS) also called impedance spectroscopy or electrochemical impedance spectroscopy, involves the study of a sample which has been subjected to an electric field of fixed or changing frequency. Microwave dielectric spectroscopy (MDS) has been widely popularized as a potential tool for inline monitoring systems. MDS is based on the rotation of molecules and their functional groups in the presence of an electromagnetic field in the frequency range of 0.3–300 GHz, which is then used to differentiate and fingerprint chemical composition in foods for safety and quality aspects. Literature however, seems to be limited to lab-scale alone, in application of DS for inline monitoring of desired parameter.

3.3 Florescence Spectroscopy

Florescence spectroscopy is based on the emission of radiation by molecules upon absorption of light. Molecules generally occupy the lowest vibrational level of the ground electronic state. On absorption of light, they are elevated to produce excited states. Energy, which is absorbed as discrete quanta, results in a series of distinct absorption bands. Having absorbed energy and reached one of the higher vibrational levels of an excited state, the molecule rapidly loses its excess of vibrational energy by collision and falls to the lowest vibrational level of the excited state. When the molecule returns to the vibrational levels of the ground state, it emits its energy in the form of fluorescence. Jablonski diagram depicts the fluorescence and phosphorescence emission of light as a result of electronic states of molecules and transitions between them (Fig. 12.5).

Fig. 12.5
A Jablonski diagram presents states S 0, S 1, S 2, and T 1. Molecules absorb light and reach state S 2 from S 0. By internal conversion, they return to S 1, and then to S 0. It results in fluorescence. Intersystem crossing from S 1 to T 1, and return from T 1 to S 0, results in phosphorescence.

Jablonski diagram depicting the fluorescence and phosphorescence emission due to electronic states of molecules and transition between them (Reproduced from Nawrocka and Lamorska 2013)

Time-integrated laser induced fluorescence spectroscopy is a sensitive technique which can be effectively used for the inline monitoring and detection of particularly surface related quality defects. In principle, the surface analysis can be divided into two important application areas: (a) analysis of functional coatings, (b) analysis of food surface. The advancement in technology which has enabled effective capture of even a single photon, offers detection of contaminants or substance of interest present even at extremely low quantities in a sample with high sensitivity by FS. This is clearly an advantage over spectroscopic techniques like NIRS and MIRS discussed earlier. However, since capture of spectral intensity distribution of fluorescence does not necessarily result in good resolution, a time-integrated approach is included in the procedure to observe the decay times of fluorescence signals in the selected wavelength range. Additionally, after excitation, the time decay of the fluorescence radiation is registered at different and appropriately positioned windows in the process operation to integrate the data. This separates the wanted signal from the background (Fig. 12.6). Fibre optic probes are used in the system which increase the depth of sample penetration and can also be cleaned easily using compressed air, gas flushing or by ultrasound techniques.

Fig. 12.6
A schematic of fluorescence spectrometer. The labeled components are T i sapphire laser, polarizer, 4 lenses, dichroic mirror, objective, stage and sample, light source, infrared filter, camera, and piezo controller.

Flow diagram of a fluorescence spectrometer (Reprinted from Kunwar et al. 2014)

The fluorescence sensitivity is increased manifold by use of photomultiplier tube which amplifies the single-fluorescence light events. Moreover, since each single-fluorescence measurement takes place in the nanosecond timescale, the results of surface measurements on moving parts or sheets does not depend on the process speed, which is an essential requirement of inline monitoring especially in the food processing industry.

3.3.1 Limitations of FS

The major limitation of FS especially in the food industry, is the noise and interference that occur due to the complex food matrix. Moreover, most compounds have broad absorption spectra which may make it difficult to identify individual species. Although a very sensitive technique which can be applied to get useful data, fluorescence measurements are sometimes not consistent over a period of time. They also require amplification devices like the photomultiplier tube and multiple measurements at different time and locations in a system to get reliable and accurate data on the sample.

3.4 Raman Spectroscopy

Raman spectroscopy (RS) is based on Raman scattering which is inelastic scattering of radiation that produces a vibrational spectrum of sample molecules. Unlike, IR spectroscopy, Raman spectra are not subjected to large interference from polar molecules such as water which makes them superior to other vibrational spectroscopies in monitoring of liquid food samples. RS was not widely investigated as a tool for monitoring and detection of organic compounds until 1980s. With advancement in technology such as development of silicon-based detector arrays, stable and high-power laser diodes, low noise, high-resolution spectrometers etc., RS promises to be an important tool in the detection of analytes/parameters in the food industry (Collette and Williams 2002; Li et al. 2014). In addition, improved hardware and advent of advanced Raman techniques such as surface enhanced Raman spectroscopy (SERS), the limit of detection has dramatically improved, thus making RS a suitable technique for inline sensing and in monitoring of chemical and biological contaminants.

Typically, a Raman spectrometer measures the “Raman shift”, which is a plot between the Raman signal intensity and shift in frequency of the Raman signal, relative to the excitation source (Fig. 12.7). In recent years, RS has been studied as a potential substitute of NIRS for application especially in high moisture foods.

Fig. 12.7
An energy diagram with ground state E 0 and excited state E 1. Both states have vibrational levels, v = 1, v = 2, v = 3, and v =4. It presents M I R, N I R, Normal Raman and Resonance Raman scattering with Rayleigh stokes and anti-stokes lines, and fluorescence.

Energy diagram for Raman scattering and fluorescence (Reproduced from Li et al. 2014)

3.5 Hyperspectral Imaging in Spectroscopy: An Advance Technique for Inline Monitoring

Hyperspectral imaging (HIS) is an advanced technique which is combined with optical spectroscopy to generate a two-dimensional image of an object or sample. Essentially, in HSI, each pixel of the image contains spectral information, which is added as a third dimension of values to the two-dimensional spatial image (Vo-dinh 2004). Hyperspectral data could combine absorption, fluorescence, or reflectance spectrum data for each image pixel (Lu and Fei 2014). Generally, as a thumb rule, HSI data is spectrally sampled at more than 20 equally distributed wavelengths. Spectroscopic chemical imaging such as HIS, not only increase the mass of material sampled, but also provide spatial distribution of spectral information, and have several advantages over color imaging such as RGB (red-green-blue) or spectroscopy alone. Figures 12.8 and 12.9 gives the flow diagram for HIS of sample on a conveyor belt. Many literature reports have recognized the role and application of hyperspectral imaging in food quality and safety which include detection of defects (Nagata et al. 2006), quality parameters of a sample (Qiao et al. 2007), microbial contamination (Yao et al. 2013), etc. Readers may refer to review papers by Feng and Sun (2012), Zhang et al. (2012), Zhang et al. 2017, ElMasry et al. (2012), Kamruzzaman et al. (2015), that cover the principles as well as application of hyperspectral imaging in several aspects of food quality and safety. HIS has been combined with NIR, MIR and Raman to derive valuable information about quality of a sample or aspects related to its contamination, adulteration and safety (Gowen et al., 2007). These include from determination of texture and firmness of fruits and vegetables to faecal contamination and defects on the surface.

Fig. 12.8
A diagram of the H I S inline system. The labeled components are the camera, camera controller interface, spectrograph, an objective, light source for reflectance, light source for transmittance, light controller, support frame, and computer.

Schematic diagram for hyperspectral imaging inline system (Reprinted from Huang et al. 2014)

Fig. 12.9
A diagram of H I S of the sample presents multiple image planes with wavelength lambda. An image plane at lambda i has a circle with 3 ellipses of different sizes. The marked point is (x i, y i). The pixel spectrum at (x i, y i) of reflectance versus wavelength has a fluctuating ascending trend.

Hyperspectral imaging hypercube showing the relationship between spectral and spatial dimensions (Reprinted from Wang 2019)

3.6 Soft Sensors

Soft sensors are advanced process monitoring systems, which use algorithms to assess measurements in an on-line manner to generate information. Spectroscopic sensors have sometimes also been described as ‘soft sensors’ due to the fact that spectroscopic data is modelled using software. There are two types of soft sensors– (a) data driven sensors and (b) model-driven sensors. Each one of them have their own advantages and drawbacks. Data driven sensors are based on conclusions that are derived from data which do not require previous process knowledge while model driven sensors are based on first principle approaches which can generally be extrapolated to new process conditions.

4 Chemometrics in Spectroscopic Analysis

As mentioned earlier, chemometrics is primarily applied to extract information from multivariate spectral data derived from NIR, FT-IR, Raman, and UV-VIS spectroscopy. Chemometrics can be defined as the use of mathematical and statistical methods to analyse data generated from a sample. The goal of chemometric analysis or multivariate data analysis is to either classify, calibrate or sometimes carry both these analyses using the multivariable data sets. Application of chemometrics provides qualitative and/or quantitative models to study the analyte, which otherwise cannot be understood using univariate methods.

In case of simple sensing reaction having an analyte and a receptor, a univariate regression for calibrating the transduction signal against the analyte concentration is used (e.g., the widely used glucose biosensing with glucose oxidase as bioreceptor). However, in real samples, the analyte is a component amongst different components (sometimes structurally similar), wherein mathematical multivariate regression might offer simpler solution rather than investing in the chemistry and physics for selective biosensing (Martynko and Kirsanov 2020). Traditional chemometrics and machine learning advancements are paving the way for newer detection, analysis and diagnosis in the field of sensors particularly inline monitoring and control to make the sensing more intelligent (Cui et al. 2020).

In case of classification problem, the multivariate data is segregated into known groups using specific unsupervised learning algorithms such as PCA (principal component analysis), SIMCA (self-independent modelling of class analogy), LDA (linear discriminant analysis), HCA (hierarchical clustering analysis), and PLS-DA (partial least squares-discriminant analysis). Later an untrained sample is used to test the established classification model. Similarly, the calibration of data using chemometric approach requires additionally the response variable information (measured using other analytical procedures) for training the data set to generate a linear or non-linear calibration models, using the supervised learning procedure. Here, PLS (partial least squares) is widely used as a linear calibration algorithm. For detailed understanding of PLS, Brereton (2000) and Wold et al. (2001) provides comprehensive information. With the explosion of machine learning tools in the last couple of decades, chemometrics received leverage in terms of newer algorithms for both classification and segregation problems. Tools such as kNN clustering (k-nearest neighbour), SVM (support vector machine), NB (Naïve Bayes classifiers), ensemble classifiers etc. are being used for classification problems, whereas SVR (support vector regression), ANN (artificial neural networks), CART (classification and regression tree), RF (random forest), MCR-ALS (multivariate curve resolution- alternating least squares) etc. are being used for regression analysis (Cui et al. 2020). One of the advantages these regression algorithms hold is the handling of non-linearity in data (Rentería-Gutiérrez et al. 2014). Deep learning methods such as CNN (convolutional neural network) and RNN (recurrent neural network) are also been used for robust analysis having non-analyte signal, and ability to handle non-linear models (Thrift and Ragan 2019; Uddin et al. 2020).

In general, chemometrics facilitates the data processing and thereby extracts the critical information for analysis as a tool. Merits and benefits of chemometrics and machine learning tools for biosensing applications are detailed comprehensively in the Cui et al. (2020). These include: (i) categorizing of signal data, (ii) anomaly detection and signal correction, (iii) improvement in signal to noise ratio, (iv) ability to conduct pattern recognition and object identification, and (v) rapid and sensitive detection by lowering the time of sensing. Traditional chemometrics can also be used as standalone soft sensor without requirement of any (bio) receptor. In such procedure, multivariate data arising from spectral analysis such as UV-Vis, NIR, FT-IR, GC, HPLC, DSC, LC-MS, IR-MS etc. are used for carrying chemometric estimations. Examples of such applications are many in food authentication and adulterant detection. Oliveira et al. (2019), Callao and Ruisánchez (2018), and Granato et al. (2018) provides comprehensive details on chemometrics- based food authentication and detection of adulterants.

Application of chemometrics- based sensing in different fields such as environmental monitoring, water quality assessment, food and beverages analysis, biological and medical chemistry are covered in Martynko and Kirsanov (2020). Some of the selected applications of chemometrics/machine learning in sensing is provided in Table 12.3.

Table 12.3 Chemometric application in spectroscopy-based determination of quality and safety parameters

Chemometrics- based data analysis, not only facilitates the sensory analysis, but also can make the process more robust, sensitive, and importantly cheaper. Batch to batch variability in the mass production of sensors can be lowered significantly if chemometrics is employed in the analytical method. Moreover, optimizing the analytical conditions for real samples is a tedious job, and chemometrics can provide a great advantage to overcome such variability in the samples. Also, with advancements in the newer tools, the chemometrics has significantly improved the analysis of spectroscopic sensing devices.

5 Selection of Spectroscopic Technique in Food Sensing

There are several factors that govern the choice of the spectroscopic technique/s in the sensing of different parameters in food when applied as an inline system. For example, NIRS is the method of choice in the determination of several physical and chemical entities in solid or dry food matrix but is usually not applied for liquid or high moisture content samples. This is because, NIR measures the absorbance of the vibrational modes of a sample and therefore large water absorbance prohibits proper measurement of the target of choice in high water content foods. In drier samples, these large absorbance bands make NIRS suitable for moisture detection. Foods with high moisture can be measured using Raman or ATR. Similarly, samples containing complex structures such as botanicals and organic materials with impurities, are preferably measured using NIRS or MIRS since RS and FS suffer from fluorescence of molecules other than the target of interest. It is also a challenge to capture Raman peaks when fluorescence is observed in the same excitation range which tends to scatter in all directions. Time resolved fluorescence is a sensitive technique but the requirement of multiple measurements at different time points and locations, restricts its use in several food applications. FS however, continues to be the suitable choice in animal and plant cell cultivation and for fermentation-based processes. Since Raman emission peaks are sharp and distinct, molecules in a mixture can be easily identified without the need for a library database for all of the sample or mixture of the sample unlike NIRS. This makes RS highly appropriate for qualitative analysis while NIRS is best suited for quantitative analysis.

It is extremely important that in-line spectroscopic instruments/sensors are able to measure required parameters of quality and safety in a dynamic environment, which is hallmark of any food industry. This may include variable environmental factors like pH and temperature, continuous movement of samples (e.g conveyor belts), continuous mixing (eg. fermentation processes), non-homogenous sample, in-flow of ingredients etc. This essentially means that any spectrometer should be designed and constructed keeping in mind the changing environment and the affect it may have on the overall result derived from the measurement. A lot of spectroscopic choices also depend on the extent of sensitivity required, type of sample, requirement and purpose of measurement, instrumentation required and ease of their integration into the process etc. As a result of cheaper instrumentation cost, robustness, availability and upgradation of computational models, NIRS has been widely used in inline monitoring.

6 In Line Monitoring of Food Quality and Safety Using Spectroscopy

The section below describes the application of spectroscopic inline sensors/devices used in various industries based on the food types. The purpose of the measurement is to contribute and describe the quality and safety of the food product. It is also necessary to mention here that spectroscopic techniques in general, have been used predominantly for qualitative analysis of samples. Majority of the publications, report the results as coefficient of correlation between developed method and conventional method for the parameter analysed by the spectroscopic method.

6.1 Dairy Products

Milk and its products are one of the most consumed food products across the world for their nutritional value. They have been evaluated for their quality parameters such as fat, protein, lactose and moisture content “inline” using NIR spectroscopy for more than 30 years in some countries (Osborne 2006). The measurement of these parameters in milk which relate to its quality, also helps to decide the further processing it requires to make products. One may refer to reviews by Kunes et al. (2021) and Pereira et al. (2020) which cover spectroscopic techniques for quality and safety assessment of milk and its products in good detail.

The protein content in milk powder-based products was analysed in a study using NIRS and values were compared to the conventional Dumas method. Results indicated that the maximum bias between the NIR method and Dumas was 3% and the developed spectroscopic method was capable of predicting the protein content (± 2%) which was present in samples in the range of 22–90% (Ingle et al. 2016). Cholesterol content was predicted using FT-NIRS coupled with partial least square (PLS) regression model in diary powders, which was claimed by the authors to have applicability as an inline monitoring tool during downstream processing of milk. Their results indicated reliable data with good comparability with the conventional HPLC method. The PLS model applied to the data was found to be satisfactory with the best performance indicators with r2 = 0.9998 and root mean square error of cross validation (RMSECV) of 1.05 mg cholesterol/100 g).

Ozbekova and Kulmyrzaev (2017), in order to predict rheological characteristics namely yield stress and flow stress, as well as chemical composition of Tilsit cheeses at melting temperatures between 20 to 70 °C used fluorescence spectroscopy. Principal component analysis (PCA) and PLSR chemometric tools were applied to the fluorescence emission and excitation spectra obtained from tryptophan residues (305–480 nm; ex: 290 nm) and Vitamin A (340–620 nm, ex: 320 nm) present in the linear viscoelastic region. PLSR predicted the yield stress and flow stress with an R2 = 0.90 from the vitamin A emission and excitation spectra, while predicted values with tryptophan residues had a regression co-efficient of R2 = 0.8. Other parameters such as melting temperatures, moisture, protein, and fat contents could also be predicted from the vitamin A emission spectra with R2 = 0.98.

In an attempt to conduct sensory evaluation of Cheddar cheese using fluorescence spectroscopy, Chiba et al. (2019) used the PLS chemometric analysis for cheese body measurements. A higher coefficient of determination was obtained for calibration (R2 = 0.80) and the predicted values were comparable to those obtained by conventional methods (Chiba et al. 2019).

Parameters such as nutritional composition (Comin et al. 2008), fatty acid composition (Ferrand-Calmels et al. 2014), and milk coagulation properties (Toffanin et al. 2015) using spectroscopic techniques have been investigated. Apart from routine quality measurements like fat, moisture and protein, several studies have focused on minerals, volatile compounds, firmness, ripening time, as well as sensory attributes of milk products like cheese, yogurt, buttermilk, etc. (Bonfatti et al. 2016; Arango and Castillo 2018; Muncan et al. 2021a; Loudiyi et al. 2017). The latest trend in the field of inline sensors, apart from traditional measurements, is to link spectral data of milk and its composition to genomic and molecular data of cattle to improve dairy cattle breeding programs and relate animal health and wellness to this data (De Marchi et al. 2018; Tiplady et al. 2020).

German dairy cooperative “Berchtesgaden”, has adopted Foss analytics based on NIR for measuring key quality parameters in their butter and cheese production process (Mills 2015). The industry claims to have improved its yield, saved on costly raw material, and improved product quality using the inline NIR system which measures fat, protein, lactose, sucrose, total dry mass, fat-free dry mass, density and acids. They report that the inline system enabled maintaining the organization’s high standards and has resulted in high brand value with satisfied customers and end users.

A very recent study investigated the use of RS and chemometrics for the determination of eight mineral elements in infant formula (Zhao et al. 2020). The authors concluded from their study that RS equipped with a non-contact fiber-optic probe had the potential for inline quantification of mineral content of infant formulas during manufacturing. The PLSR model developed using all samples for calibration, achieved a predicted mineral content in samples with R2CV values of 0.51–0.95 and RMSECVs of 0.13–2.96 ppm. Validation of the method was also carried out with R2CV values between 0.93–0.97 for minerals tested (prediction of Ca, Mg, K, Na, Fe, and Zn). ICP-AES was used as a reference method for the determination of the mineral content. This study assumes importance in the background of quick and easy detection of proper labelling in the commercial formulas for mineral content which can truly reflect their nutritional value.

Further, milk being a highly valued and consumed natural product, is often adulterated with cheap and unsafe chemicals like melamine, starch, citrate, sucrose, urea, cheaper sources of proteins etc., which also require early detection. Adulteration of melamine in milk and milk products has been investigated using spectroscopic techniques (Liang et al. 2021). It may be noted that many of these studies and reports are publications and still need to be demonstrated in industrial settings. The purpose of including publications is to appraise the readers of the latest research work in the area.

6.2 Meat and Their Products

Meat and their products are important source of dietary components such as proteins, polyunsaturated fatty acids, vitamins, and minerals. However, they are highly perishable food commodities and their quality declines rapidly during storage due to enzymatic autolysis, microbial growth and oxidation (Kondjoyan et al. 2018). Several intrinsic and extrinsic factors in meat make them easily susceptible to both chemical and microbial spoilage. Since, they are considered reasonably expensive products, monitoring their quality and composition during industrial operations has a direct bearing on the final product and ultimately affects consumer satisfaction, safety and also profit margins.

Meat quality indicators like pH, colour, water-holding capacity, tenderness, intramuscular fat, protein and moisture content, adulteration with other types of animal tissues, collagen, etc., have been the main focus of research and development of inline spectroscopic sensors. Categorising and grading meat, detecting frozen-thawed from fresh meat, and discriminating feeding regimes, have been implemented in several industries. Among them, NIR spectroscopy has been applied for inline monitoring of water, fat and protein in meat, since a very long time. The first report of NIRS application “in-line” in an industrial setting was reported by Isaksson et al. (1996). A diffuse NIR instrument was set at the outlet of the meat grinder to determine key quality parameters of ground beef on a conveyor belt. A multiple linear regression (MLR) used as the calibration model determined the fat, moisture, and protein contents in ground beef. Kamruzzaman et al. (2016) successfully used hyperspectral imaging as an online monitoring system to determine colour of red meat, an extremely important quality attribute that governs purchase decisions of consumers. For ease in industrial application, a set of feature wavelength for red meat color (L*, a*, b) was selected. Multiple linear regression models developed were able to predict L* (R2 = 0.97), a* (R2 = 0.84) and b* (R2 = 0.82) with a root mean square error (RMSE) of 1.72, 1.73, and 1.35, respectively, indicating potential to be used for rapid assessment of meat color. The work of Robert et al. (2021) demonstrated the ability of RS to rapidly discriminate intact beef, venison and lamb meat and highlights the applicability of the technique in meat sorting and authentication. The authors used three chemometric techniques in combination with RS to discriminate the meat samples. The linear and non-linear support vector machine (SVM) model used by the authors could achieve sensitivities between 87 and 90% respectively with specificity above 88% in the validation set.

A plethora of information is available on NIRS for quality determination in meat and meat products as published literature and several reviews on the same are also available (Porep et al. 2015; Dixit et al. 2017; Preito et al. 2017). The use of MIR for evaluation of meat and its products for quality and safety has been sufficiently covered by Su and Sun (2019). Wang et al. (2018) in their review have covered in detail spectroscopic techniques for determination of fresh red meat quality, safety and classification.

In real-world scenario, several industries have already established dedicated instruments and have factory-set calibration systems (mostly NIR) that determine the protein, fat and moisture contents of meat and meat products like cooked meat, cooked ham, pepperoni, liver sausage, etc. (Osborne 2006). The other applications of spectral techniques are limited largely to publications and need to see the light of the day in “inline” settings of the industry.

6.3 Cereals and Cereal Products

Grading of grains is an important parameter not only to ensure quality of product which would be derived after processing but also for economic gains during export. Since the value and price of grains is fixed based on their quality, any minor variation has a direct consequence on revenue to the exporter. The quality of grains is determined by its protein and starch content as well as hardness. Canada, Australia, USA and Europe have implemented NIRS for protein estimation of grains like wheat and barley as early as 1960s (Osborne 2006). It has also been used to predict the optimum fertilizer requirements of cereal crops by analysing the nitrogen content and total carbohydrates in plant tissue samples. It is indeed interesting to note that spectroscopic inline monitoring of wheat quality by means of analysing its protein content, has led to huge cost savings in countries like Canada, where the technique has become routine in its wheat segregation programmes.

In the context of developing nations like India, application of IoT and real time monitoring is paramount since loss of grains have huge economic implications. A review of real time monitoring and control of grain quality during transportation, purchase and storage is provided by Hema et al. 2020. Readers may refer to Tian et al. (2020) who have provided a review of sensor technologies including NIR, MIR, Raman and FS in monitoring of wheat quality.

In an attempt to study the rheological and baking properties of wheat flour. Ahmad et al. (2016a), used FS and applied PLSR. The amount of protein, wet gluten and sedimentation coefficient was determined in the wheat flour samples and results indicated linear regression (R2) values of 0.90, 0.92 and 0.81 for the three determinants, respectively. The same authors in another study (Ahmad et al. 2016b) observed that, nutritional values of different commercially available wheat flours could also be reasonably well predicted by FS using the local weighted regression (LWR) model. When the wheat flours were evaluated for the energy values (R2 = 0.96), protein R2 = 0.93), fat (R2 = 0.99), moisture (R2 = 0.99), carbohydrates (R2 = 0.98), sucrose (R2 = 0.99), salt (R2 = 0.89) and saturated fatty acids (R2 = 0.99), was obtained indicating its capability to make accurate “inline” measurements.

Protein, gluten, moisture, and starch was estimated using NIRS, to grade the quality as well as rheological property of wheat samples. The spectral region between 1000 to 2500 nm was found to be the most suitable for determination of protein, gluten and starch while 680 to 2500 nm could determine the moisture content in samples, using the PLS model. Good coefficient of prediction (R2p) values between 0.94–0.98 and acceptable standard error of prediction (SEP) between 4.82–9.79 were obtained for the samples (Ibrahim 2018).

Buhler, the world leader in cereal processing, has established online sensor systems integrated with various processing steps in several of its facilities. These include among others, protein and moisture determination in incoming wheat to select the right silo, adjust the mill to specific ash content, add gluten powder to increase protein levels, or blend different flours for a perfect product (https://www.buhlergroup.com).

NIRS has been used to monitor batter mixing and physicochemical changes of dough with respect to consistency variation and gluten network (Kaddour et al. (2008). Dough mixing characteristics have also been monitored inline by Wesley et al. (1998) using NIRS. In comparison to other spectroscopic techniques, NIRS seems to be the method of choice for monitoring several chemical and physical parameters of cereal and cereal products.

6.4 Fermentation Based Processes

Spectroscopic techniques have been used to monitor analyte concentrations in microbial fermentations mostly as at-line measurements, where a sample is removed from the reactor and measured on a spectrometer situated close to the process (Guo et al. 2012; Liang et al. 2013). However, although this reduces the time as compared to off-line assessment, it still requires removal of sample for the determination. Several authors have attempted in-line spectroscopic techniques for various microbial parameters in bioprocess monitoring and have relatively been successful (Lee et al. 2004, Petersen et al. 2010; Bogomolov et al. 2015). Alves-Rausch et al. (2014) were able to demonstrate the use of NIRS where Bacillus fermentation was monitored at an industrial scale in bioreactors (50 L), under harsh industrial conditions. They used a BioPAT® Spectro NIR sensor, with clean in place (CIP) and sterilization in place (SIP) capabilities to detect variations and classify media. Additionally, spore counts, acetoin, dry mass, and sugar concentrations could be determined using multiparametric, multivariate analysis for fast, sensitive, non-destructive and robust measurements (Alves-Rausch et al. 2014).

It is highly desirable that sensors employed for bioreactor monitoring must be capable of measuring even low concentrations of various nutrients or metabolites without interference from the complex, multiphasic matrix which is inherent in a fermentation process (Lourenço et al. 2012, Abu-Absi et al. 2014, Sivakesava et al. 2001a, Sivakesava et al. 2001b). For this reason, Bonk et al. 2011, used two in-situ online-methods namely in situ microscopy (ISM) and 2D fluorescence spectroscopy to monitor the cell density as well as the glucose, lactate and glutamate concentration during cultivation of CHO-K1 cells. It was demonstrated that ISM could monitor cell density with the same accuracy as that of conventional technique (Neubauer counting chamber) and fluorescence spectroscopy was equally capable of monitoring the selected metabolites with good accuracy and repeatability. Such on-line techniques in bioprocess monitoring could be extremely helpful in reducing the risk of contamination especially during cultivation of sensitive cells, by avoiding frequent sampling which is the drawback of offline measurements (Bonk et al. 2011).

The last two decades have seen a rise in number of commercial particle-monitoring sensors which have been extensively applied in inline monitoring especially in bioprocesses like fermentation (Muncan et al. 2021b). Some examples include probe-based sensors like SOPAT, Mettler Toledo Particle View, flow-cell based sensors Sympatec, ParticleTech, etc. (Gargalo 2020).

Raman spectroscopy was used along with chemometric procedures for in-line monitoring of glucose fermentation by Saccharomyces sp. The use of multivariate control charts enabled easy and rapid detection of any fault in the process line without requirement of sample preparation and was based only on the spectra of the system (Avila et al. 2012).

NIR spectroscopy was used inline along with electronic nose (EN) in a fed btch cultivation process to monitor and control a cholera-toxin producing Vibrio cholerae. Biomass, glucose and acetate production was monitored based on spectral identification and prediction models were built. The PLSR model could generate high correlation to reference data with appreciable R2p for biomass (0.20 g l−1), glucose (0.26 g l−1) and acetate (0.28 g l−1). The authors built a trajectory representation of the fed batch cultivation using the NIR and EN data using the PCA. Any bacterial contamination could be easily detected with a change or deviation in the normal trajectory. This in situ monitoring with NIRS was claimed to be robust with an SEP of 0.020 g l−1 for determination of the cholera toxin. The acetate formation by the bacteria could also be controlled efficiently using the data for biomass concentration (Navrátil et al. 2005).

6.5 Wine, Brewing and Distilleries

The wine, brewing and distillery industry has been using inline sensors for monitoring the original gravity and alcohol content in the samples. In the brewing industry, the sensors are generally NIR based and data is collected online from flow-through cells. Transmittance or transflectance cells are used and it is established that the standard errors for the evaluation are less than 0.2%. NIR has also been used to monitor fruit quality and determine the alcohol content of wine and dedicated filter instruments for wine analysis are commercially available.

Although performed ex-situ, Grassi et al. (2014), demonstrated that (FTIR-ATR) spectroscopy could be a good technique to assess sugars and ethanol concentration for the inline monitoring of beer fermentation. Multivariate curve resolution-alternating least squares (MCR-ALS) models developed by them could successfully predict the fermentation progression with a 99.9% of explained variance, 3.5% lack of fit, and standard deviation of the residuals lower than 0.023. The FT-IR and MCR-ALS models could describe spectral changes of the main components of wort namely the sugars and ethanol concentration.

Trivellin et al. 2018, developed a completely different strategy based on fluorescence behavior of metal/porphyrin complex to measure oxygen levels at different time points during fermentation. The system was based on use of an optical fiber probe to measure luminescent lifetime variation of the complex which decayed in the presence of oxygen. Dynamic modelling techniques were used to predict the nutrient evolution in space and time at defined measuring points for the purpose of process monitoring and control. The experimental validation was done at an actual Italian winery.

6.6 Fruits and Vegetables

Quality assessment of fruit and vegetables involves evaluation of its appropriate maturity, structure, texture, chemical composition, and the absence of defects like bruises, browning, microbial growth, insect damage etc. They have also been evaluated for total soluble solids content as an indicator of sweetness, total acidity as an indicator of sourness, total dry matter as an indication of maturity, moisture content as an index of juiciness, lycopene content for nutraceutical value, overall texture including for firmness and toughness. The conventional method of measurement of the internal quality in most food industries still happens to be offline, destructive analysis. However, spectroscopic techniques (MIR, NIR, RS, FS) and others like x-ray imaging, and nuclear magnetic resonance spectroscopy (NMR), have been explored and some have also been adopted in industries (Irudayaraj and Reh 2008). An overview of spectroscopic, multispectral imaging and hyperspectral imaging techniques for quality attributes, measurement and variety discrimination of fruit and vegetable species is presented by Wang et al. (2015) and Sirisomboon (2018) and may be referred for further reading.

6.7 Freshness of Food Products

In many sectors of the food industry, sensory assessment (which include colour, texture, taste, odour, appearance etc.) of food product has been traditionally used to evaluate the freshness of a product such as fruits, vegetables, meat and fish etc. The sensory assessment is done by a panel of trained experts who score the quality of the product by established protocols. For example, “quality index method” is used to assess the quality of the fish (Hassoun et al. 2019). The fish processing units evaluate and monitor the quality and safety of fish by methods such as pH, ATP, total volatile basic nitrogen, trimethylamine, microbial plate count technique, etc. These methods are time consuming and labour intensive and moreover not “real-time”. The traditional methods of sensory assessment are slowly being replaced by instrumental sensory methods that mimic the human system. Referred to as the “biomimetic” sensors, instruments such as “e-nose” that mimic olfactory system, “e-tongue” that mimic the gustatory system and “e-eye” that mimic the visual system are now being used to evaluate several parameters reflecting the quality and safety of food products. However, these systems are not covered in the chapter. Readers may refer to reviews by Jiang et al. (2018) and Tan and Xu (2021) for further reading on applications of these techniques in quality and freshness monitoring.

Vis-NIRS reflectance spectroscopy was used for authenticating fresh and frozen-thawed swordfish by Fasolato et al. (2012). Authors integrated Visible and NIR to draw predictions and found that the results were better than (accuracy >96.7%) when the data was taken individually. VIS/NIRS was found be a useful tool to differentiate fresh and frozen-thawed fish in another study with an overall classification rate in the range of 80% and 91% (Ottavian et al. 2013).

A very recent review by Franceschelli et al. (2021), covers a wide range of sensor technologies for monitoring fish freshness and quality. Article by Sarkar et al. (2019) may also be referred which compares the advantages of polarization reflectance spectroscopy over other non-invasive, rapid and real time tools like NIR, hyperspectral imaging and machine vision for monitoring the freshness of fruits.

6.8 Authenticity and Adulteration

It is a consumer right, that the food that is purchased should be in compliance with its label description, whether in respect to nutritional composition, allergen declaration, geographical origin, method of production, etc. Additionally, adulteration and food fraud also create health hazard, apart from economic losses in case of trade (Ropodi et al. 2016). Inline sensors can help manufacturers evaluate the raw material or ingredient which may have been sourced from different regions. For example, fruit distillates are affected by botanical origin as well as the region and climatic conditions in which the fruits are grown (geographical origin). Especially with respect to the quality of the distillate, the chemical constituents dictate the uniqueness of the product which is highly dependent on the raw material specific to the region and have been traditionally conserved. In this direction, it is very important to not only ensure high-quality but also detect false claims of assigning a region for product origin. In a recent study, Raman spectroscopy was used to differentiate distillates with respect to their trademark, geographical and botanical origin by Berghian-Grosan and MagDas (2020). Authors evaluated eight fruit distillates (apple, apricot, cherry, grape, pear, plum, quince, sour-cherry) containing between 40 to 80% alcohol by volume. The proposed approach had a model accuracy of 95.5% for trademark fingerprint while an accuracy of (90.9%) was achieved for the geographical discrimination of the fruit spirits (Berghian-Grosan and Magdas 2020). Inline application of this method was suggested by the authors to rule out adulteration and flavour masking of the product.

Adulteration in food samples is rampant especially in underdeveloped and developing countries due to several socio-economic reasons. Adulteration in high value products like olive oil with cheaper alternates like sunflower oil using applied VIS and NIR transflectance spectra has been studied (Downey et al. 2002). In another example, a modified real coded-GA coupled to PLS (RCGA-PLS) was developed which was found to be better in terms of sensitivity and fingerprinting of tartarzine in comparison to other chemometric tools such as PLS, GA-PLS, BiPLS and CARS-PLS for the detection of adulteration of tartrazine in tea (Amsaraj and Mutturi 2021). The detection range was found to be 0–30 mg/g using the FT-IR coupled system. Such studies can be extremely helpful especially for regulatory agencies to monitor adulteration particularly “on the field”.

In a study by Downey and Kelly (2004), strawberry and raspberry purees were adulterated with cooked apples (10–75% w/w) and NIR transflectance measurement was used to predict the adulteration. The prediction of apple content was achieved in the 1100–1880 nm range for strawberry and 400–1880 nm range for raspberry after using PLS chemometric tool. The study concluded that the detection was possible when adulteration exceed 25% of raspberry and 20% of strawberry purees.

Su and Sun (2017), explored the application of spectral imaging for detection of adulteration of organic flour (Irish organic wheat flour; OWF) with cassava flour (CaF), common wheat flour (WF), and corn flour (CoF). OWF samples were adulterated with different percentages of other flours. RC-FMCIA-PLSR model was reported to be the best for the determination of adulteration with a coefficient of prediction (R2P) of 0.97 and a root mean square error of prediction (RMSEP) of 0.036 for CoF adulteration in OWF, R2P of 0.986 and RMSEP of 0.026 for OWF adulterated with CaF, and R2P of 0.971 and RMSEP of 0.038 for OWF adulterated with WF. The applicable range for authentication of the admixtures in specific wheat flour was found to be 3–75% (w/w).

6.9 Microbial Safety and Hygiene

Microbial safety and hygiene are one of the most important parameters to be monitored in a food processing industry. Processing machines, equipments, conveyor belts, pipes, wash waters, packaging material, personnel, etc., are important sources of microbes. Visual detection, off-line plating and swabbing for ATP analysis are the commonly used techniques of microbial analysis. Generally, Cleaning-in-Place (CIP) and Sterilization-in-place (SIP) are available to clean and disinfect without disassembling or assembling any components in a process. Noninvasive techniques can be very useful to monitor as well as control microbial growth in any process. Readers may refer article by Lobete et al. (2015) to get useful insights on non-invasive techniques for microbial load analysis. Much of the literature on spectroscopic analysis of microbial safety and hygiene are publications, and ATRS, RS etc. have been widely used for total biomass analysis in fermentation experiments. Fluorescence microscopy coupled gel-cassette has also been reported for fermentation-based process especially to study function of inoculum level in cheese as the model matrix (Jeanson et al. 2011).

7 Limitations of Spectroscopy

Although used widely because of the several advantages they offer for “inline” monitoring, spectroscopic techniques suffer from certain drawbacks. Since many spectroscopic applications are based on reflectance mode, the presence of the source and the detector on the same probe results in low penetration depth of the radiation in the sample. In addition, low sampling mass due to restricted area of the probe also results in non-representative measurements, increase in standard deviation as well as underestimates the degree of homogeneity. Several attempts and interventions have been made to overcome these limitations specially to increase the sampling size. Many industries therefore have adopted inclusion of multiple probes at different locations, combine spectroscopy with other supporting techniques such as imaging, and automate the probes by mounting them on motorized translational stages to get repeatable data at different time points.

Apart from some technical drawbacks mentioned above, spectroscopic sensors also suffer from high cost of instrumentation and sometimes requirement of highly qualified personnel. Innovation in the field of spectroscopic sensors and their actual implementation in the food industry has also been slow (although publications are in explosion) due to lack of clear understanding and documentation of analytical systems actually used by the industries. Moreover, many industries do not prefer to disclose or publish their monitoring procedures mainly to avoid competition and regulatory attention.

8 Emerging Technologies for Inline Monitoring and Control of Food Quality and Safety

8.1 Biosensors

Biosensors are devices that convert biological signal into an electrical one. They have been extensively used in the field of medical diagnostics and less explored as inline probes for process monitoring although some attempts have been made in the past especially in the field of fermentation.

Tric et al. (2017), reported application of enzyme-based biosensor for continuous monitoring of glucose which was applied for animal cell culture optimization studies in bioreactors. The optical biosensor which enabled assessment of internal concentration of hydrogen peroxide; the by-product of the glucose oxidation reaction, also reported the turnover rate of the enzyme glucose oxidase as an important factor to be considered for the monitoring purpose. The sensor performance was validated using experimental data with conventional techniques and numerical simulations were derived for the process. More importantly, the sensor was easily sterilizable using beta and UV irradiation, demonstrating its application in real-life industrial processes. Automated online biosensors to detect microbes and their toxins have been developed for water monitoring (Shi et al. 2013; Ettenauer et al. 2015). A sulphur-oxidising bacteria was used for real time monitoring of heavy metals and other toxic chemicals in water (Hassan et al. 2019). Several researchers have reported detection of E.coli “on line” for monitoring of water quality with sensitivity as high as two colony forming units (Kellner et al. 2016).

Thakur and Ragavan (2013) have presented a comprehensive review on application of biosensors in food processing, including their potential role in inline monitoring of food quality and safety. The group has worked extensively in the development of biosensors for detection of multiple food contaminants like pesticides (Kumar et al. 2001; Gulla et al. 2002; Lisa et al. 2009), heavy metals (Ranjan et al. 2012), microbial toxins and pathogens (Vinayaka and Thakur 2011; Thakur et al. 2010), and adulterants like formaldehyde (Akshath et al. 2012; Akshath and Bhatt 2018). Apart from enzymes and antibodies, development of aptasensors for food relevant molecules such as antibiotics, myco- and algal toxins, etc. have also been investigated (Sharma et al. 2019; Mukherjee et al. 2017; Mukherjee et al. 2021). Many of these sensing platforms can further be fine-tuned for on line sensing with appropriate integration of other technologies to develop devices to monitor food contamination.

Despite a huge number of research studies on biosensors for the food industry, this technology has not been translated widely as successful commercial products for food diagnostics. There are multiple reasons which include factors like stability of the biosensing element, performance fluctuations with changing environment, sensor fouling, problems with reusability and regeneration issues, cost involved, etc. However, with advancement in science and technology, biosensors continue to hold the promise to be exploited in the agrifood industry especially for onsite and online monitoring of quality and safety.

8.2 Acoustic Sensors

Acoustic sensors use scattering and reflecting of sound waves when they interact with matter. These waves which travel through matter, cause oscillations without causing any alteration to the structure of the material. Passive acoustics introduce no external sound waves while active acoustic analysis refers to introduction of sound waves to a system and then monitor the changes caused. This sensor technology has wide applications in the food industry especially as a noninvasive technique. Some examples of application of acoustic technology include assessing the crispiness of product (Arimi et al. 2012), texture of fruit (Costa et al. 2011), firmness of fruit or vegetables (Jancso et al. 2001), discriminating between material for further processing (Elbatawi 2008), etc. Although investigated since 2001, especially for assessing sensorial aspects of a product, this technology has not been explored in a big way in “inline” sensing and carries the potential to be applied in food quality monitoring and control.

8.3 Magnetic Resonance Imaging

Magnetic resonance is referred to as the interaction which occurs between atomic particles and an applied external magnetic field. Resonance occurs due to absorption and emission of energy at specific frequencies which is in turn a function of individual atomic particles as well as strength of the applied magnetic field. When magnetic resonance is applied to develop images of an object or its internal structures, it is referred to as magnetic resonance imaging (MRI). MRI is obtained as a signal of spatial co-ordinates within a sample. MRI is also a non-destructive, non-invasive technique which has been used to assess the quality of products particularly fruit and vegetables and meat and meat products. Review by Hamed et al. (2018) may be referred to for literature on MRI based sensing platforms.

9 Future Perspectives

FDA in its guidance framework of 2004, has emphasized the use of monitoring and control approaches such as PAT tools, to improve and guarantee product quality in the “manufacturing” sector. The intent is to replace established product release and validation protocols which are presently being carried out by costly and time consuming laboratory analysis, to a more process-oriented real-time monitoring and control which ensures “Quality by Design” (QbD). PAT will have to be implemented in the food industry and technologies that are rapid, non-destructive and robust can play a very important role to increase profits for the food business as well as satisfy consumer demands with consistency and uniformity in the quality and safety of the product. In this direction, spectroscopy-based sensors will continue to be extremely useful tools for “inline” monitoring and determination of food quality and safety.

Spectroscopy based inline sensors offer several advantages over conventional methods of analysis. These include among others, minimal to negligible sample preparation, analysis of large composite varieties, non-destructive and non-invasive nature, less overall analysis time, less processing cost, environment friendly, easy to operate, capability to be coupled to cloud –based IoT devices, no specialized training for operation, etc. However, the main drawback in the use of spectroscopy-based sensors in the food industry for real-time monitoring has been to overcome challenges related to sensitivity of calibration, specificity, spectral changes accompanying varietal differences, climate and season variations, environmental variations influencing the sample, internal and external constituents impacting the determinants and most importantly high initial cost of instrumentation and its maintenance (although analysis per sample becomes cheaper when used for routine analysis in the long run). Many of these challenges have been addressed partially with advancement in computation, technological developments in optical sensors, companies venturing into mass production, use of AI and machine learning tools, exploration of other regions of the electromagnetic spectra, information-driven automation, metadata acquisition etc. The role of software, especially for sensor application in inline or online monitoring has also been extremely important in overcoming many of these challenges.

There is no doubt, that monitoring and control of processes and products using cloud-based services for traceable performance and safety verification will have to be integrated to enable huge profits as well as impart credibility to a food industry. In future, optimization of process steps using inline sensor tools will result in maximizing economic dividends. Apart from early detection of events, predictive maintenance that indicate immediate action will have great implications to the industry in forthcoming years. Sensors that are able to generate data on process know-how and detect hazards real-time is the need of the hour today.

Apart from advanced programming software, and data processing algorithms, it is also necessary that sensors developed in future should be field-deployable, compact and can be easily integrated into existing industrial processes. The future is therefore for smart, small and sensible sensors. Both the sensor and the software should be able to predict and present repeatable, reliable and robust measurements of variables that dictate process and product safety and quality with less or no requirement of trained personnel.

In conclusion, empowering food industry to transition to Industry 4.0 operations, is a win-win for all stakeholders, both the industry and the customers. Improved productivity, product quality and safety by introducing more advanced inline monitoring and control strategies is the way forward for the food manufacturing sector. At present, the progress on inline sensors are restricted mainly to publications or restricted only to certain parameters specific to a food product. The advantages offered by inline sensor systems are far greater than what appears on the surface and the food industry needs to implement and plan actionable strategies to reap its full benefits.