Detection of ripeness grades of berries using an electronic nose

Abstract The estimation of ripeness is a significant section of quality determination since maturity at harvest can affect sensory and storage properties of fruits. A possible tactic for defining the grade of ripeness is sensing the aromatic volatiles released by fruit using electronic nose (e‐nose). For detection of the five ripeness grades of berries (whiteberry and blackberry), the e‐nose machine was designed and fabricated. Artificial neural networks (ANN), principal components analysis (PCA), and linear discriminant analysis (LDA) were applied for pattern recognition of array sensors. The best structure (10–11‐5) can classify the samples in five classes in ANN analysis with a precision of 100% and 88.3% for blackberry and whiteberry, respectively. Also, PCA analysis characterized 97% and 93% variance in the blackberry and whiteberry, respectively. The least correct classification for whiteberry was observed in the LDA method.

The e-nose is one of the most promising nondestructive methods which have proven to be good alternatives for common techniques in odor analysis of food (Qiu, Wang, & Gao, 2015). The e-nose contains several electronic gas sensors, which have sensitivity and selectivity to volatile compounds present in the sample headspace of food products. Through the use of a pattern recognition algorithm that processes the resistance data from each sensor, the volatile compound data are expressed as a thorough via multivariate analysis (Kim et al., 2013).
The statistical methods employed to multivariate output data obtained by the sensor array signals are based on commercial or specially designed software using multivariate classification methods like PCA, LDA, and ANN (Beghi, Buratti, Giovenzana, Benedetti, & Guidetti, 2017). The e-nose has had several applications in monitoring aroma changes during fruits, such as apple (Pathange, Mallikarjunan, Marini, O'Keefe, & Vaughan, 2006), peach (Su et al., 2013;Zhang, Wang, Ye, & Chang, 2012), mango (Lebrun, Plotto, Goodner, Ducamp, & Baldwin, 2008;Zakaria et al., 2012), and tomato (Gómez, Hu, Wang, & Pereira, 2006). Infante, Rubio, Meneses, and Contador (2011) applied an e-nose for sensory quality evaluation of ripe nectarines segregated. The sensory analysis and the e-nose results were presented through a PCA. Breijo, Guarrasi, Peris, Fillol, and Pinatti (2013) and Li, Xue, and Chen (2012) studied persimmon fruits to discriminate between two different cultivars using a semiconductor commercial e-nose sensor array to recognize fruit ripening state and storage life, applying PCA and LDA statistical methods. Zakaria et al. (2012) reported the classification of mango maturity levels using a fusion of the data of an electronic nose and an acoustic sensor. The e-nose evaluated samples and then followed by the acoustic sensor. PCA and LDA were able to classify the mango harvested at week seven and week eight based solely on the aroma and volatile gases released from the mangoes. Parpinello et al. (2007) used the e-nose to analyze the headspace of 10 different apricot cultivars. Applying a single hidden layer ANN with 35 neurons, a correlation index higher than 80% on test data set was achieved. Lu, Deng, Zhu, and Tian (2015) employed an e-nose to classification of rice, and PCA was used to preprocess data from electronic systems. This paper wants to investigate an application of e-nose to detect the ripeness grade of berries, based on an e-nose and proper pattern recognition methods (PCA, LDA, ANN), in whiteberry and blackberry.

| 1. Electronic nose setup
For detection of the ripeness of fruits, the e-nose machine was designed and fabricated. The e-nose mainly composed of data acquisition card (USB self-designed), sensor array, three two-way valves normally closed, vacuum pump, air filter (active carbon), GUI (graphical user interface) (LabVIEW 2014), power supply, laptop, and sample chamber. The schematic of the e-nose apparatus is shown in Figure 1.
The fruit is set in the sample chamber for collecting adequate gases.
In the e-nose system, the static headspace technique is used to collect volatile (unstable) gases emitted from the sample. The vacuum pump with flow rate 6 L/min was used to transfer volatile and fresh air to the sensor array.
To automatically control the cleaning and obtain the aroma pattern, the e-nose machine was equipped with three two-way valves 1/4 inch normally closed. As the sample odor enters the sensor chamber, depending on the concentration of the sample violet, the type of sensor and sensibility of each sensor exhibit a proportional response that the sensor response converts into a voltage by its circuit and transmitted to the data acquisition card (USB self-designed).
This information is sent to the computer after being received by the data acquisition card for recording and display via the GUI (LabVIEW 2014). After each measurement, both chamber sample and sensor array are cleaned with filtered dry air by active carbon. The power required by the device is supplied in two ways, while the device is connected to the computer, required power is provided through the USB port of the computer, but when the e-nose is used for on-site experiments, the power (energy) required is supplied by the backup lithium-ion battery.
The sensor array is combined with ten different metal oxide sensors. Table 1 shows all the sensors and corresponding applications.
MOS gas sensors, as a typical commercial sensor, are extensively employed in e-nose (Hu et al., 2016;Sun et al., 2017). These sensors F I G U R E 1 Schematic of the components of the electronic nose device are widely used in e-nose machines due to their high chemical consistency, long life, low response to moisture, and reasonable prices (Sanaeifar, Mohtasebi, Ghasemi-Varnamkhasti, & Ahmadi, 2016).
Metal oxide semiconductor sensors need to be heated about 400°C before testing to detect the gases accurately. Therefore, sensors were equipped with a 5 V DC heating voltage. To omit the effects of temperature changes on the sensory array, the temperature of samples was held at 30°C.
The measurement procedure was started by placing fruits in the sample chamber. Preliminary experiments showed that the headspace achieved a steady state after the 1800s of equilibration, so those experiments were done after the 1800s of equilibration. They were designed to reinforce the odor concentration to obtain more sensor responses.
The main stages of electronic nose work consist of three phases: 1-baseline, 2-injection of sample odor into the sensor chamber, and 3-clearing the sensor array. The response of the sensors during these three-time phases is recorded as voltage versus time.
In the baseline stage, the filtered air enters the sensor array by passing the vacuum pump and the valve 1 and cleans the sensor array to retain a stable voltage change in the sensors and was exited from valve 3 (300s). At the injection step, the sample odor enters the sensor array through the valve 2 and vacuum pump (300s). In the final stage, the filtered air enters the sensor array through the vacuum pump and valve 2, on the other hand, exits through the valve 3 to perform the cleanup process (150s) (Figure 1).
Data prepared from the sensors are applied to create a database required for training the e-nose. Through the data attainment card, the sensors' responses are saved on the computer. The database is a matrix whose rows are the responses of the sensors, and its columns are the e-nose sensors. Then, signal preprocessing is used for the extraction of data from the obtained responses and also for the preparation of the data for pattern analysis (Wall, Rechtsteiner, & Rocha, 2003). The significant features of this preprocessing are (a) baseline identification, (b) compression, and (c) normalization.
The fractional method was employed in the current study for baseline manipulation. The fractional method is also extensively applied for MOS chemoresistors (Gutierrez-Osuna, 2002) where X S (0) is the baseline response, X S (t) is the sensor response, and Y S (t) is the normalized response of the sensor. In compression preprocessing, the maximum response value for each sensor was individually extracted and analyzed. Using the fractional method in MOS sensors also, the data are normalized (Hai & Wang, 2006;Heidarbeigi et al., 2015).

| Sample preparation
Whiteberry and blackberry samples were collected from 5-year-old mulberry trees from Iran. Healthy samples were randomly picked from multiple trees and divided into five ripeness grades (RG1 = ripe, RG2 = close to ripeness, RG3 = intermediate to ripeness, RG4 = close to unripe, and RG5 = unripe) according to the criteria used by expert growers (mainly relying on size and surface color distribution) during June 2019. The weight of each sample was measured as 10 ± 1 g. The 120 sample fruits were packaged in an insulated box containing ice and immediately transported to the laboratory for analysis.

| Sample preparation
A total of 100 g of the frozen mulberry fruit were ground in a commercial blender (Philips, model HR2850) for 30 s. The flesh pulp was then thawed for maceration at -4°C for two hours before TA B L E 1 Gas sensor array of the e-nose centrifuged at 4000 × g at 4°C for 20 min. Finally, the sample was filtered through a muslin cloth to obtain the clean juice.
Five mililitre of the clean juice, 5 μl of 4-methyl-2-pentanol (2.0200 g/L) as an internal standard, and 1 g of NaCl were added into a 15 ml vial, which was tightly capped with a polytetrafluoroethylene-silicon septum and sealed with a polypropylene screw cap. After mixing, the sample was equilibrated at 40°C on a magnetic platform (PC-400, Supelco) for 30 min, a preconditioned 2 cm long 50/30 μm DVB/CAR/PDMS (divinylbenzene/carboxen/polydimethylsiloxane). SPME fiber (Supelco) was inserted through the cap and placed 1 cm above the juice to extract free volatiles at 40°C for 30 min. The SPME fiber was injected into a GC-MS injector for thermal desorption at 250°C for 8 min. The same extraction procedure was previously employed for the aroma analysis of mulberry (Chen et al., 2015).

| GC-MS analysis
An

| Data analysis
One uncontrolled (PCA) and two controlled (ANN and LDA) pattern recognition models were used to classify fruit samples to varying degrees of ripening.
PCA is the best descriptor of differences between the samples.
It has been mostly employed in the paper to display an embodiment of clusters and outliers of the e-nose response to aroma . Also, PCA helps to detect which principal components derived from the initial variances show the most differences.
LDA is one of the most used classification methods (Maugis, Celeux, & Martin-Magniette, 2011). This technique minimizes the variance within categories and maximizes the variance between-category differences (Patel, 2014). So, LDA can gather data from all sensors to amplify the groups.
In this research, a three-layer feed forward neural network has been used that maps input data onto a set of proper outputs. In this research, the input layer of the network consisted of several neurons corresponding to sensors. The output layer had neurons according to grades of ripening fruits. Best number of neurons for the hidden layer were chosen basis on experiment and error. The data were divided into two subsets: 75% were applied for training, and 25% were used for testing. The hyperbolic tangent (tansig) and the linear (purelin) transfer functions were employed in the neurons of the hidden and output layers. The Levenberg-Marquardt training algorithm was used to train the network. Precision was applied as the classification performance function to find the optimal architecture for the neural network (Sokolova & Lapalme, 2009

| GC results
In this study, GC-MS was used for the determination of different volatile in berries. The volatile aroma compounds found in whiteberry and blackberry (

| Comparison of sensor array responses and GC results
The response of the sensory array for whiteberry is shown in Figure 2. As it is known, RGs have different response patterns. This is due to change in volatile aroma compounds during maturation. Many rapid qualitative and quantitative changes in berry fruit volatiles during ripening is related to steam organic solvents such as esters, furaneol and mesifurane, acids, lactones, terpenes, and alcohols (Forney et al., 2000;Jetti, Yang, Kurnianta, Finn, & Qian, 2007;Ménager, Jost, & Aubert, 2004).These important volatile compounds were detectable by MQ3 and TGS822 sensors as well as GC-MS (Table 1 and   Table 2). Volatile sulfur compounds can be presented in many different chemical forms, including hydrogen sulfide, methanethiol, dimethyl sulfide, dimethyl disulfide, dimethyl trisulfide, methyl thioacetate, and methyl thiobutyrate that have been identified by GC-MS (Table 2) and TGS2602 sensors (Table 1) in whiteberry and blackberry fruits.
The harvest maturity plays a pivotal role in the volatile development of berries. C6 aldehydes were identified as the major compounds in immature white fruit, while furanone and esters are present in three quarters or fully red fruit (Ménager et al., 2004). Yang, Wang, Wu, Fang, and Li (2011) reported that all the organic compounds such as alcohols and carbonyls, along with most of the C6 compounds and terpenoids, were evident before veraison in three different flavor table-grapes, while most of the esters were detected at or after veraison. C6 compounds increased in the early period of maturation and then decreased. Most alcohols and carbonyls tended to decrease during ripening continuously. Some esters continued to increase after maturation and, terpenoids increased until maturation, then reduced. Du, Song, and Rouseff, (2011) reported with increasing degree of maturity, volatile sulfur concentrations increased and at full ripe and overripe maturity stages increased exponentially.

| PCA results
The first two main components of PCA showed more than 90% of the variance of data; therefore, these two components were used for PCA plots (Figure 3). The PCA score plots of PC1-PC2 explained 97% and 93% of the variance for blackberry and whiteberry, respectively. In Figure 3a, PC1 and PC2 described 87% and 10%, respectively, of the variance between samples. All of the RG were clustered well by PCA (Figure 3a). In Figure 3b, PC1 and PC2 described 85% and 8%, respectively, of the variance between samples. RG4 and RG5
To determine the contribution of each sensor in the pattern rec-

| LDA results
For blackberry, LDA could distinguish RGs well, but RG4 and RG5 and RG2 and RG3 have little overlap. The accuracy of the analysis was 96.67% (Figure 5a). LDA was not able to identify RGs of whiteberry well, because RG4 and RG5 and RG1 and RG2 have a great overlap. The accuracy of the analysis was 85% (Figure 5b). In two berries was seen overlap between RG4 and RG5; therefore, it can be concluded that there is no clear difference in the aromatic compounds of these two groups especially in whiteberry. Qiu et al. (2015) were studied about discrimination and characterization of strawberry juice based on electronic nose and tongue.
LDA, PLSR, RF, and SVM methods were applied for data analysis.
The result showed LDA is useful tool for discrimination.

| ANN results
To minimize ANN training time, only one hidden layer was considered. The best network was found with 10-11-5 topology, that is, a network having 11 neurons in the hidden layer for all berries. Table 3 shows the confusion matrices. Samples were classified with correct classification percentage of 88.3% and 100% for whiteberry and blackberry. The lowest classification and precision were seen for RG4 and RG5 of whiteberry which can be due to the slight difference in violate compounds. Most fruit flavor volatiles are secondary metabolites and absent during the early grades of fruit formation.
Therefore, fruits in first grades of maturity are not separated and could not be differentiated using volatile compounds. These results are in agreement with the results of LDA.
The results of Du et al. (2011) indicated that volatile sulfur concentrations were mostly absent at the early maturity grades, such as the white and red half grades. Brezmes, Llobet, Vilanova, Saiz, and Correig (2000) investigated fruit ripeness monitoring using an e-nose. Based on the neural network as a pattern recognition technique, the system designed was able to categorize fruit samples into three different grades of ripeness green, ripe, and overripe with prefect accuracy.

| CON CLUS ION
In this research, a fabricated electronic nose with ten metal oxide semiconductor sensors with LDA, PCA, and ANN to determine the ripeness grades of whiteberry and blackberry was used.
Three pattern recognitions were able to classify the RGs of berries well. But ANN and PCA for blackberry with the correct classification percentage 100% and explanation 97% of the variance of samples are the best methods. According to the study, it can be expressed that an e-nose is a useful tool for detecting the ripeness grades of berries and can be used with less time and cost to determine the appropriate harvest time. MQ3 and TGS2602 sensors showed the highest contribution and MQ9, TGS2611, and TGS2610 sensors showed the lowest response in identifying the