Assessment of Ripening Degree of Avocado by Electrical Impedance Spectroscopy and Support Vector Machine

Avocado, a climacteric fruit, exerts high rate of respiration and ethylene production and thereby subject to ripening during storage. erefore, its ripening is a signicant factor to impart optimum quality in postharvest storage. To understand the dynamics of ripening and to assess the degree of ripening in the avocado, electrical sensing technique is utilized in this study. In particular, electrical impedance spectroscopy (EIS) is found to uncover the physiological and structural characteristics in plants and vegetables and to follow physiological progressions due to environmental impacts. In this work, we present an approach that will integrate EIS and machine learning technique that allows us to monitor the ripening degree of the avocado. It is evident from our study that the impedance absolute magnitude of the avocado gradually decreases as the ripening stages (rm, breaking, ripe, and overripe) proceed at a particular frequency. In addition, principal component analysis shows that impedance magnitude (two principal components combined explain 99.95% variation) has better discrimination capabilities for ripening degrees compared to impedance phase angle, impedance real part, and impedance imaginary part. Our classier utilizes two principal component features over 100 EIS responses and demonstrates classication over rm, breaking, ripe, and overripe stages with an accuracy of 90%, precision of 93%, recall of 90%, f1-score of 90%, and auc of 88%. e study oers plant scientists a low cost and nondestructive approach to monitor postharvest ripening process for quality control during storage.


Introduction
Avocados receive an increasing attention for extending nutritional food choice and agribusiness in United States [1].According to a recent report from the National Agricultural Statistics Service of United States Department of Agriculture, the value of U.S. avocado production measured $316 million in 2016-17 [2] and U.S. consumption of avocados increased signi cantly from 1.1 pounds per capita in 1989 to a record 7.1 pounds per capita in 2016.Avocado, being a climacteric fruit, has a high rate of postharvest respiration.Consequently, it is one of the most perishable fruits and has very limited shelf life.It is prone to biochemical and physiological deterioration during postharvest ripening accompanied by degradation of visual appearance. is postharvest loss poses the risk of loss of market value of the avocado.In addition, from the point of view of consumer industry, only optimum ripening state attributes to the most nutritional value and best taste of a fruit.Hence, a better understanding of ripening dynamics of avocado can play a vital role to the development of appropriate tool for better packaging, storage, and transportation process and consequently meet the demand of both agribusiness and consumer industry.
Conventional chemical and biochemical analyses conducted to investigate the fruit ripening are limited by factors such as processing time and destructive nature [3].ese methods are often laborious and expensive and require access to laboratory facility.Hence, these methods prove to be infeasible for a repetitive inspection.erefore, it is essential to expand current technologies from di erent viewpoints.A nondestructive, low cost, and easily accessible solution to this issue needs to be devised.
Nondestructive methods such as magnetic resonance imaging (MRI) and CTscan are found to be e ective towards understanding of ripening, internal fruit quality, and postharvest processing [4,5].MRI method requires separation of signal of water proton from that of fat proton which is still a challenging task.And both MRI and CT are limited by the factors such as high cost and processing complexity.Hyperspectral imaging can effectively assess ripening degrees [6], but it also suffers from constrains such as cost and processing.
erefore, it is essential to expand current technologies from different viewpoints.On the contrary, electrical impedance spectroscopy (EIS) is a fast, low cost, and nondestructive method which is found to offer insight into plant physiology and physiological dynamics due to environmental impacts.In this direction, the EIS studies have been conducted as a nondestructive evaluation method to investigate the impedance spectrum variations and to determine the ripening degree in the avocado.
To develop an easily accessible and nondestructive method to understand mechanisms of ripening and to assess ripening degree of the avocado, the prospect of EIS technique is explored in this paper.is work on the avocado mainly focuses on the investigation of feasibility of EIS for assessment of the ripening degree nondestructively.e rest of the paper is organized as follows: related past works on application of EIS technique is reviewed in the Literature Review section.e next section introduces the theory of bioimpedance and electrical impedance spectroscopy.Later on, experimental methods and materials are illustrated.After that, the experimental and simulated results are presented and discussed, and finally, paper is concluded including some future exploration directions.

Literature Review
Impedance sensing technology especially EIS has emerged a new era into food quality and stability over the last decades.It has been extensively used in the field of plant physiology, agriculture, and food engineering for quality control and assessment of fruits and vegetables such as banana [7], Garut citrus [8], kiwi [9], lettuce [10], nectarine [11], and strawberry [12].In order to assess the freshness of banana, EIS investigation was performed during different ripening states [7].By attaching Ag/AgCl electrode and injecting a small amount of current, impedance responses are measured by the 4294 A impedance analyzer over a frequency range of 50 Hz to 1 MHz.e impedance magnitude, phase angle, real part, and imaginary part varied markedly with the alteration of the ripening state.
González-Araiza et al. [13] designed a nondestructive device to obtain the impedance spectrum of the whole strawberry fruit and later on performed classification by utilizing corresponding equivalent circuit parameters (constant phase element, CPE-P, and R infinity ).e study showed that the strawberries at the highest stage of ripeness had significantly lower constant phase element and Ro (related to extracellular) values compared to other strawberries.
Neto et al. [14] utilized EIS technique for the determination of the maturation degree of mangoes based on variation of bulk resistance dependence with maturation of fruits.ey came up with this strategy to normalize bulk resistance by diameter to compensate the size variations of samples.ey demonstrated good agreement between variation of electrical response and mechanical response of fruit.
Montoya et al. [15] investigated that electrical conductivity could be a suitable factor for assessment of quality during ripening and cold storage.ey found some resemblances between electrical conductivity response and ethylene productions curve.
ey defined a threshold of conductivity (0.24 S/m) that indicates the limiting value for fruit stored at noninjurious temperatures and subsequently transferred to 20 °C for marketing.
Chowdhury et al. [16] carried out EIS study on the mandarin orange fruit during ripening in a spectrum between 50 Hz and 1 MHz.ey observed significant variation of the impedance, phase angle, real part, and imaginary part of the impedance with different states of orange ripening.
e study also demonstrated loss of weight of corresponding samples with the progression of ripening states.us, electrical sensing specially EIS technique was found to offer insight into physiology of fruits and vegetables undergoing the ripening process.

Theory of Bioimpedance and Electrical
Impedance Spectroscopy e plant body is a complex biological structure composed of tissues which are developed with cells suspended in extracellular fluids (ECF) [17].Again, cells are composed of intracellular fluids (ICF), cell membrane (CM), and cell wall (CW).ECF, ICF, and CM are developed with different materials and so exhibit distinguishable electrical attributes.
e ECF and ICF act as electrolytes and provide a conducting path to applied alternating current [18].e CM is a protein-lipid-protein (P-L-P) structure and exhibits capacitance to the current.Consequently, the overall response of the biological tissues to an alternating electrical signal generates a complex sbioelectrical impedance.Mathematically, the impedance Z∠(θ) is calculated by dividing the voltage (V∠(θ 1 )) measured by applied current (I∠(θ 2 )) as Bioimpedance is a complex quantity which varies with tissue composition and frequency of the applied signal.
erefore, the frequency-dependent bioimpedance can be represented as where R b (ω) and X b (ω) represent the magnitude of the real part of the complex Z b (ω) and the magnitude of the imaginary part of the complex Z b (ω), respectively.
Bioimpedance is sensitive to the physiological status of plant tissue.Again, as the response of bioimpedance changes with frequency, a multifrequency impedance analysis can offer better insight into plant physiology and better understanding to plant tissue status.Electrical impedance spectroscopy (EIS) is a multifrequency analysis for studying complex electrical impedance, Z(ω), and its phase angle, θ(ω), at different frequency points, 2 Journal of Food Quality EIS is performed by measuring the surface potentials, V(ω), occurring from a constant current injection, I(ω), at the boundary through a linear array of the surface electrodes attached to the sample-under test (SUT).

EIS Measurement.
Impedance measurement on the avocado was carried out with the EVAL-AD5933 Evaluation Board, a high precision impedance converter system.e device integrates an on-board frequency generator, a 12-bit 1 MSPS analog-to-digital converter (ADC), and an internal temperature sensor.Both the excitation signal and response signal are sampled by ADC and Fourier transformed by an on-board DSP engine in order to obtain complex impedance spectrum.e frequency range of AD5933 is from 5 kHz up to 100 kHz without external components, and lower frequencies than 5 kHz are achievable using an external divider.e device has a master clock of 16.77 MHz and supply voltage requirement of 2.7 V to 5.5 V. e device comes in a 16-SSOP package that has a temperature range of −40 °C to +125 °C.e device offers high accuracy and versatility that make it suitable for electrochemical analysis, corrosion monitoring, automotive sensors, proximity sensing, and bioimpedance measurements.
e experimental setup of EIS data acquisition system is presented in Figure 1(a).e graphical user interface of the supporting software is presented in Figure 1(b).e electrode holder platform has a height of 10 centimeter, and the holder is horizontally movable and vertically rotatable.A noninvasive two-electrode measurement system was employed in our experiment where "alligator-" type Ag electrode clips were connected with circular electrode plates from ECG electrode, and finally, "alligator" clips were tied with the electrode holders.Similar separations of 4.4 centimeter between two electrodes were maintained for all measurements.To compensate the contact resistance, a layer of electrode gel ("Spectra 360" salt-free electrode gel) was placed between ECG electrode plate and test subject (avocado fruits).For impedance spectroscopy measurements in this study, we used a 1 V p-p generator voltage and scanned 101 spot frequencies (frequency intervals) between 5 kHz and 15 kHz.
e AC signal injected into the sample was generated by the built-in function generator of the evaluation board.
e avocado fruits for our experiment were collected from a local supermarket "Sobeys" in Saskatoon, Saskatchewan, Canada.During the period of experiment, avocados were kept in the lab environment.e temperature in the lab was 20 °C, and relative humidity was 40%.Further experiment can be conducted with freshly harvested avocados and stored in different controlled temperatures in future studies.

Feature Extraction by Principal Component Analysis (PCA)
. PCA is mathematically defined as an orthogonal linear transformation that converts a set of data (possibly correlated) into a new set of linearly uncorrelated data called principal components.
e first principal component contains the largest percentage of data variance, and the variance decreases in the following principal components.In this study, PCAs were carried out with data obtained from the samples in order to assess the feasibility of the EIS technique to discriminate among different ripening stages of the avocado.PCA served the purpose of dimensionality reduction and feature extraction on EIS data.PCA was performed over impedance magnitude, impedance phase angle, impedance real part, and impedance imaginary part over the predefined frequency range, where the device shows maximum sensitivity.

Classification by Multiclass Support Vector Machine (SVM)
. Support vector machines (SVMs) are supervised learning models which construct an optimal hyperplane to classify data into different classes.And lines drawn parallel to this separating line are the supporting hyperplanes, and the distance between them is called the decision margin.e width of the margin is constrained by support vectors which are the data points that are closest to the separating hyperplane.Since the optimal hyperplane is the one that separates the high probability density areas of the classes with maximum possible margin between them, the goal is to determine the direction that provides the maximum margin.It needs the solution of following optimization problem in Equation ( 3) for a given training set of instance label pairs (x l , y l ), l � 1, 2, . . ., i where x l ∈ R n and y l ∈ 1, −1 subjected to y l � u T ϕ x l  + e  ≥ 1 − ξ l , ξ l ≥ 0. ( For quantitative analysis of discrimination of ripening degrees based on EIS data, a multiclass support vector machine was modeled.e ground truths for all the samples were generated by subjective testing.In this direction, ripening chart and ripening information of the avocado were utilized.
e ripening chart of the avocado used in this experiment is presented in Figure 2.

Results and Discussion
Ripening is the process by which fruits attain their desirable color, flavor, palatable nature, and other textural properties that make the fruit acceptable for consumption.Ripening is associated with change in biochemical composition, that is, conversion of starch to sugar.
e avocado, being a climacteric fruit, continues to ripen after harvest.During the ripening process, it emits ethylene along with the increased rate of respiration.e EIS study on the avocado was undertaken with an attempt to better understand and identify the ripening stages of the avocado in terms of electrical bioimpedance.
e EIS studies conducted for the avocado sample show that at a particular frequency (especially for less than 10 KHz), the avocado impedance magnitude gradually decreases as ripening stages ( rm, breaking, ripe, and overripe) proceed (Figure 3(a)).And for a particular maturity degree, impedance magnitude decreased signicantly from low to high frequency especially for rm, breaking, and ripe stages.At lower frequency, the electrical current ows only through extracellular uids which acts as electrolytes and have relatively high resistance.e cell membrane exerts extreme high capacitance at low frequency and that is why electrical current cannot pass through intracellular uid and only ows through the extracellular uid.At high frequency, cell membrane capacitance reduces signi cantly and current ows through intracellular uid, which has relatively low resistance. is is how impedance declines markedly from low to high frequency area of impedance spectra.
is phenomenon resulting from cell structures in biological tissue is known as β dispersion.Figure 3(b) shows that the phase angle of avocado impedance varies with frequency throughout the ripening stages.At a particular frequency, the avocado impedance phase angle gradually increases as ripening stages ( rm, breaking, ripe, and overripe) proceed (Figure 3(b)).And especially on high-frequency range of the spectrum (10 KHz to 15 KHz), for a particular maturity degree, the impedance phase angle rises as the frequency increases.
EIS study on the avocado was extended to multiple samples to uncover the dynamics of ripening with respect to  Journal of Food Quality impedance-frequency response.One hundred di erent EIS responses belonging to di erent ripening degrees were recorded and are shown in Figure 4.It can be intuitively concluded that impedance magnitude best re ects the ripening degrees.Now to better visualize and analyze the large data obtained from all EIS responses, principal component analysis (PCA) was carried out over impedance magnitude, impedance phase angle, impedance real part, and impedance imaginary part.Furthermore, PCA was used to obtain a reduced number of uncorrelated variables, which are the principal components (PCs).PCA was able to reduce the initial 101 variables (for every impedance parameter) to 2 PCs which combined and explained a signi cant percentage of the total variance.e rst principal component and second principal component over impedance magnitude explained, respectively, 98.67% and 1.28% of total variance in the data.PCA over impedance magnitude, impedance phase angle, impedance real part, and impedance imaginary part is demonstrated, respectively, in Figures 5(a)-5(d).Especially in the PCA2-PCA1 score plot of impedance magnitude (Figure 5(a)), it is apparent that the data for every ripening degrees tend to cluster, and in general, four different zones can be separated.It is evident that PCA feature 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1. 4 1.5 Frequency in Hz ×10 4 Real part of impedance in ohm 6 Journal of Food Quality from impedance magnitude has better discrimination capabilities for ripening degrees compared to impedance phase angle, impedance real part, and impedance imaginary part.
In addition, for quantitative investigation of the prospect of EIS parameters towards discrimination of ripening degrees, a supervised classi er model was developed.Our experimental dataset is composed of 100 EIS responses containing 19 responses from rm class, 26 from breaking class, 26 from ripe class, and 29 from overripe class.During experiment, the database was divided into two sets: the training set containing 60 responses and the testing set containing 40 responses.For feature extraction from EIS data, PCA was carried out over impedance magnitude, impedance phase angle, impedance real part, and impedance imaginary part.By analyzing discrimination capabilities of di erent impedance parameters, only PCA1 and PCA2 over impedance magnitude were selected to feed to our classi er.For classi cation purpose, a multiclass support vector machine with "linear" Kernel was utilized.For performance evaluation of the classi cation model, performance parameters such as accuracy, precision, recall, and F1-score were calculated.Accuracy, most intuitive performance measure, is simply a ratio of correctly predicted observation to the total observations.Precision is the ratio of correctly predicted positive observations to the total predicted positive observations.e recall is intuitively the ability of the classi er to nd all the positive samples.e F-beta score can be interpreted as a weighted harmonic mean of the precision and recall.At the 60%-40% train-test split, the testing accuracy of the classi cation was 90%.e other performance measures are illustrated in Table 1.
To assess the accuracy of a classi cation, it is common practice to create a confusion matrix, where classi cation results are compared to additional ground truth information.Figure 6 shows the graphical representation of the confusion matrix containing test data for rm (class 0), breaking (class 1), ripe (class 2), and overripe (class 3).A receiver operating characteristic (ROC) curve is created by plotting the true positive rate (TPR) against the false positive rate (FPR) at various threshold settings.It illustrates that the diagnostic ability of a classi er system and the area under the ROC curve, called AUC, is an e ective summarization of its performance.Figure 7 shows that the average area under the ROC curve is 88% that indicates excellent discrimination capabilities of our classi er.
In 2011, a study was performed by Rehman et al. [19] to investigate the ripening process of the mango utilizing electrical impedance spectroscopy technique.To discriminate raw and ripe mango fruits, they measured bulk impedance by LCR meter and expressed in terms of e ective resistance and e ective capacitance in the frequency range of 1 to 200 KHz.ey came up with a ratio of e ective resistance of ripe to raw fruit that is signi cant enough at 1 KHz to characterize raw and ripe state.ey also found the ratio of e ective capacitance of raw and ripe mango and concluded that the ratio of e ective resistance shows better discrimination capabilities at 1-6 KHz compared to e ective capacitance.In our study, we di erentiated among four ripening states of the avocado utilizing impedance spectra at 5 KHz to 15 KHz utilizing AD5933 evaluation board.is impedance converter board is low cost compared to the LCR-800 GW Instek in their study.Also, it supports automated frequency sweep which their LCR meter lacks.e feature extraction by principal component analysis over impedance magnitude directly (instead of e ective resistance or capacitance) was enough for our support vector machine classi er.As their study only di erentiated binary classes (raw and ripe), we performed multiclass classi cation among rm, breaking, ripe, and overripe avocado.e study o ers plant scientists a low cost and nondestructive approach to monitor postharvest ripening process of the avocado for quality control during storage.

Conclusion
e feasibility of electrical impedance spectroscopy, a nondestructive technique, to assess the ripening degree of the avocado has been explored in this study.A low cost, easily accessible, and nondestructive system based on AD5933 impedance analyzer has been investigated in this work.e electrical impedance parameter especially impedance absolute magnitude is found to be most sensitive to ripening progression on the avocado.In addition, principal component analysis over frequency-dependent electrical response corroborates the hypothesis of distinguishing ripening states based on EIS.Our classi er based on multiclass support vector machines shows excellent discriminant capabilities of EIS technique to track and analyze 4 ripening stages ( rm, breaking, ripe, and overripe) of the avocado. is approach can be a potential alternative to conventional chemical analysis techniques with o ering of better time and cost saving and less processing complexity.e proposed system can be extended and tested to other fruits for analyzing their ripening dynamics nondestructively and to be addressed in future studies.

Figure 1 :Figure 2 :
Figure 1: Hardware and software utilized for data acquisition: (a) AD5933 evaluation board and (b) snapshot of the supporting software's graphic user interface.

Figure 3 :
Figure 3: EIS response of avocado during ripening: (a) impedance magnitude vs. frequency and (b) negative phase angle vs. frequency.

Figure 4 :
Figure 4: EIS response of all experimental avocado samples during ripening: (a) impedance magnitude vs. frequency, (b) negative phase angle vs. frequency, (c) real part of impedance vs. frequency, and (d) imaginary part of impedance vs. frequency.

Figure 6 :Figure 7 :
Figure 6: Plot of confusion matrix for test data.

Table 1 :
Performance scores of proposed algorithm.