Discrimination of Inner Injury of Korla Fragrant Pear Based on Multi-Electrical Parameters

Inner-injury fragrant pears are easily prone to rot during storage. Discriminating inner injury in the Korla fragrant pear from the normal pear is difficult as the flesh may be injured while the peel of the fruit remains intact. This study demonstrated the recognition of inner-injury pears based on their electric characteristics to pick out the inner-injury pears before storage. The electrical parameters parallel equivalent capacitance, quality factor, parallel equivalent inductance, parallel equivalent resistance, complex impedance, and phase angle were measured using the fruit electrical characteristic detection instrument. Principal component analysis and correlation analysis were used to determine the characteristic parameters, connected with the qualitative value of the fragrant pear to establish three discrimination models. When the measurement frequency was 100 kHz, compared with the Naïve Bayes and K-nearest neighbor models, the Support Vector Machine model with the characteristic parameters of quality factor, parallel equivalent resistance, and phase angle performed best. The recognition accuracy of the test set was 92.00%, the precision was 92.41%, the recall was 97.33%, and the F1 score was 0.95. Therefore, the electrical characteristic technique effectively detected the inner injury of fragrant pears and provided a new way to distinguish the inner injury of fruits.


Introduction
Korla fragrant pears are hand-harvested, graded, and packaged. Following harvesting, 85% of the pears are stored and sold at the appropriate time [1]. Fragrant pear has a thin pericarp and crispy sarcocarp, and improper handling would cause irreversible injury to the pear. The appearance of inner-injury fragrant pears is identical to that of normal fragrant pears, and they can be stored in the same manner. This part of fragrant pears is perishable during the storage period [2]. If not removed promptly after decay, it will infect other fragrant pears, resulting in greater losses. To reduce the economic losses of storage enterprises, inner-injury pears should be sorted out before storage and sold in grades or used as raw materials for pear processing products. Therefore, it is of great significance to use a non-destructive and accurate method to detect inner-injury fragrant pears for storage enterprises.
In recent years, researchers have mainly used hyperspectral imaging [3][4][5][6][7][8][9], machine vision [10,11], thermal imaging [12], nuclear magnetic resonance [13], electronic nose [14], multispectral reflection, and fluorescence imaging [9] to detect mechanical damage, bruise, and the internal quality of fruit. However, these technologies are limited in practical application due to the high equipment costs, long data acquisition and processing time, and possible health and safety issues [15]. Therefore, a fast and reliable method for detecting fruit injury is required.
The electrical properties' detection technology has the characteristics of being fast, simple, and non-destructive, and is increasingly used in the detection of agricultural in the experiment were equipped with cotton gloves from picking pears to the end of the experiment to prevent the pears from being damaged.

Experimental Equipment and Data Acquisition
Electrical parameter acquisition equipment mainly included an LCR digital bridge, parallel plate electrode, shielding box, and sample holding adjustment device, as shown in Figure 1. The LCR digital bridge model was TH2828s (Tonghui Electronics Co., Ltd., Changzhou, China), with a measurement frequency range of 20 Hz~1 MHz. The electrode was a circular copper parallel plate electrode with a diameter of 30 mm. The air between the polar plates and the surface of Korla fragrant pear may affect the measurement results. A pair of conductive sponges were placed on the surface of the upper and lower polar plates, and Korla pear was sandwiched between the conductive sponges of the two plates. When the preload holding force is greater than 1.5 N, it has a great influence on electrical parameters. In this study, a preload of 1.0 N was used [28]. The electrodes were connected to the digital bridge via a coaxial cable through a fourterminal pair configuration, and the measurement results were displayed on the bridge screen and then recorded.

Circuit Model
Fruit cells had electrical properties similar to resistance and capacitance. When the direct current was applied to it, all the current passed through the resistance due to the infinite capacitive reactance of the capacitor. However, if the alternating current was applied, most of the current that passed through the capacitor and flowed through varied with the frequency. Agricultural materials might be viewed as an equivalent circuit made of capacitance and resistance in series and parallel based on the properties of capacitance and resistance [29].
Series and parallel equivalent circuit configurations are available for the LCR's electrical parameter measurement circuit. For the most part, a series equivalent circuit was employed to test low-impedance elements with a value lower than 100 Ω, while a parallel equivalent circuit was employed to test high-impedance components [30]. The impedance values measured in this experiment were more than 100 Ω, and the parallel equivalent circuit was used to measure the electrical parameters.
The frequencies were set to 10 kHz, 100 kHz, and 1 MHz, while the measuring voltage was set to 1 V. As the internal medium of the capacitor, a fragrant pear sample was positioned between the electrodes. The driving current output by the sine wave generator The air between the polar plates and the surface of Korla fragrant pear may affect the measurement results. A pair of conductive sponges were placed on the surface of the upper and lower polar plates, and Korla pear was sandwiched between the conductive sponges of the two plates. When the preload holding force is greater than 1.5 N, it has a great influence on electrical parameters. In this study, a preload of 1.0 N was used [28]. The electrodes were connected to the digital bridge via a coaxial cable through a four-terminal pair configuration, and the measurement results were displayed on the bridge screen and then recorded.

Circuit Model
Fruit cells had electrical properties similar to resistance and capacitance. When the direct current was applied to it, all the current passed through the resistance due to the infinite capacitive reactance of the capacitor. However, if the alternating current was applied, most of the current that passed through the capacitor and flowed through varied with the frequency. Agricultural materials might be viewed as an equivalent circuit made of capacitance and resistance in series and parallel based on the properties of capacitance and resistance [29].
Series and parallel equivalent circuit configurations are available for the LCR's electrical parameter measurement circuit. For the most part, a series equivalent circuit was employed to test low-impedance elements with a value lower than 100 Ω, while a parallel equivalent circuit was employed to test high-impedance components [30]. The impedance values measured in this experiment were more than 100 Ω, and the parallel equivalent circuit was used to measure the electrical parameters.
The frequencies were set to 10 kHz, 100 kHz, and 1 MHz, while the measuring voltage was set to 1 V. As the internal medium of the capacitor, a fragrant pear sample was positioned between the electrodes. The driving current output by the sine wave generator flows through a circuit formed of fruit as the capacitor medium. The electrical parameters equivalent capacitance (Cp), quality factor (Q), equivalent resistance (Rp), complex impedance (Z), parallel equivalent inductance (Lp), and phase angle (θ) of fragrant pear were measured.

Data Processing and Analysis
The electrical parameters were subjected to principal component analysis and correlation analysis to determine the best modeling parameters. Origin 2019b (OriginLab Corporation, Northampton, MA, USA) was used to analyze the data and depict the analysis results.
A correlation between variables can be understood as a particular amount of information overlap between variables. Principal Component Analysis (PCA) is the process of replacing duplicate variables (related variables) with extracted features in all variables, creating as few new variables as possible, making these new variables irrelevant, and retaining as much original information as possible when reflecting target information [31]. By modeling utilizing features taken from main components as input parameters, noise and interference from redundant information may decrease, and the model's ability to predict outcomes might be improved [32].
The correlation analysis method was utilized to examine the relationship between electrical parameters as well as the relationship between electrical parameters and category labels. To describe the degree of correlation between electrical measurements and category labels, the correlation coefficient r was used. A negative correlation was denoted by a negative value, whereas a positive correlation was indicated by a positive number. The stronger the correlation, the larger the absolute value of the correlation coefficient. |r| ≤ 0.1 indicated no correlation, 0.1 < |r| < 0.4 indicated a weak linear correlation, 0.4 < |r| < 0.7 indicated a medium linear correlation, 0.7 < |r| < 0.9 indicated a strong correlation, and |r| > 0.9 indicated a highly correlated relationship [33].

Classification Modeling Method
It is a binary classification issue to distinguish inner-injury pear from normal pear. Naïve Bayes (NB), K-nearest neighbor (KNN), and Support Vector Machine (SVM) were all popular classification approaches. Cover and Hart first proposed the K-nearest neighbor approach in 1968 [34]. They believed that proximity samples had similar categories, and their classification was based on the distance between the closest k samples in the feature space. Naïve Bayes was an algorithm that used the Bayesian theorem to classify small-or medium-sized data [35]. SVM was a learning classification method proposed by Cortes and Vapnik based on statistical theory [36]. It was a binary classification model that constructed the optimal hyperplane with the maximum classification interval to solve classification problems, with the characteristics of fewer redundant samples and good robustness.
Depending on whether or not the samples were subjected to pressure, they were labeled 0 or 1. After static pressure treatment, 0 represented normal pear and 1 represented inner-injury pear. The non-destructive pear and the inner-injury pear were randomly divided into the training and the test sets according to the ratio of 3:1. A training set of 300 samples was used for modeling, and a set of 100 samples was used to test the models' discrimination ability. The modeling and model validation processes were completed with the software Matlab2019a (Mathworks Inc., Natick, MA, USA).

Model Evaluation
The performance of the NB, SVM, and KNN classification models for recognition was assessed using accuracy, precision, recall, and F 1 score [37]. For the binary classification problem, samples can be divided into true positive (TP), false positive (FP), true negative (TN), and false negative (FN) according to the combination of the true and predicted categories. If TP, FP, TN, and FN represent the corresponding number of samples, then TP + FP + TN + FN = total number of samples. Accuracy is the ratio of correct classification, defined as: Precision is the ratio of actual positives to the total predicted positives, defined as: Recall is the ratio of true positives to total actual positives in the data, defined as: F 1 score is defined as the harmonic mean of precision and recall is a single summary measure of a classifier's performance.
In this study, the samples of inner-injury fragrant pears were designated as the positive group (with the label as 1), while the normal samples were designated as the negative group (with the label as 0). True positive samples were the inner-injury fragrant pears that were recognized as inner-injury fragrant pears, true negative samples were the normal fragrant pears that were recognized as normal fragrant pears, false positive samples were the normal fragrant pears that were recognized as inner-injury fragrant pears, and false negative samples were the inner-injury fragrant pears that were recognized as normal pears.

Electrical Parameters
The electrical parameters of the samples at three frequencies are shown in Tables 1-3. Taking Table 1 as an example, at the measuring frequency of 10 kHz, there was no discernible difference between inner injury and normal fragrant pears in terms of parallel equivalent capacitance, parallel equivalent inductance, or complex impedance. There was no discernible difference in the group of inner-injury degrees for the parallel equivalent capacitance, parallel equivalent inductance, and complex impedance. For inner injury and normal fragrant pears, there were considerable changes in the quality factor, parallel equivalent resistance, and phase angle. The quality factor, parallel equivalent resistance, and phase angle among the various levels of inner injury in fragrant pears varied significantly.   The mean values ± standard deviations followed by different letters in the column differ significantly (p < 0.05). Cp: parallel equivalent capacitance; Q: quality factor; Lp: parallel equivalent inductance; Rp: parallel equivalent resistance; Z: impedance; θ: phase angle; D: the amount of deformation set to create inner injury.
The parallel equivalent capacitance and parallel equivalent inductance of inner-injury fragrant pears were comparable to those of normal pears at all measurement frequencies (Tables 1-3). The findings demonstrated that the deformation causing the inner injury to fragrant pear would not result in an obvious change in capacitor capacitance in a parallel circuit. In this study, the detection circuit was capacitive; the inductance measured with a capacitive circuit was negative and had no practical significance. It was improper to use these two parameters to identify the inner injury of fragrant pear. The differences in quality factor, parallel equivalent resistance, and phase angle between the inner injury and normal pear were obvious. The inner-injury fragrant pear had larger quality factors, parallel equivalent resistance, and phase angles than the normal fragrant pear did. The values of the quality factors, parallel equivalent resistance, and phase angles increased with the degree of inner injury. This may be the result of alterations in fragrant pear pulp tissue brought on by recessive injury [2].
The complex impedance of the inner-injury pear was different from that of the nondestructive pear. The complex impedance value of the inner-injury pear measured at 10 kHz was greater than that of the non-destructive pear ( Table 1), while that of the innerinjury pear measured at 100 kHz and 1 MHz was less than that of the non-destructive pear (Tables 2 and 3). The measurement frequency had a significant impact on the complex impedance [38]. The influence of measurement frequency should be considered when complex impedance is used as a characteristic parameter.

Correlation Analysis
The correlation coefficient between electrical parameters and category labels was determined by the Spearman correlation analysis method was displayed in Figure 2a. Strongly correlated factors may be used as classification feature parameters. The correlation coefficients between the parallel equivalent capacitance, complex impedance, and parallel equivalent inductance, measured at three frequencies, were all less than 0.3 in absolute terms (Figure 2a), indicating that there was little relationship between these three parameters and the classification labels [33]. The absolute values of the correlation coefficients between the quality factor, parallel equivalent resistance, phase angle, and classification labels were mostly greater than 0.5 (Figure 2a), indicating that these three parameters had a certain correlation with classification labels of non-destructive and inner-injury fragrant pears, and could be used as characteristic electrical parameters to distinguish normal fragrant pears from inner-injury pears. Figure 2b-d show the correlation coefficients between electrical parameters obtained using the Pearson correlation analysis method. The electrical parameters measured at 10 kHz and 100 kHz had strong correlations (Figure 2b,c). The correlations between quality factor, parallel equivalent resistance, and phase angle were strong, as were the correlations between parallel equivalent capacitance, complex impedance, and parallel equivalent inductance, while the correlations between the two groups of parameters were weaker. At the measurement frequency of 1 MHz, there was a high correlation among the quality factor, parallel equivalent resistance, and phase angle (Figure 2d). There was also a significant correlation between parallel equivalent resistance and parallel equivalent capacitance, complex impedance, and parallel equivalent inductance. Principal component analysis was used to reduce the dimension because there was information redundancy between electrical parameters.   (Figure 2b,c). The correlations between quality factor, parallel equivalent resistance, and phase angle were strong, as were the correlations between parallel equivalent capacitance, complex impedance, and parallel equivalent inductance, while the correlations between the two groups of parameters were weaker. At the measurement frequency of 1 MHz, there was a high correlation among the quality factor, parallel equivalent resistance, and phase angle (Figure 2d). There was also a significant correlation between parallel equivalent resistance and parallel equivalent capacitance, complex impedance, and parallel equivalent inductance. Principal component

Principal Component Analysis
Principal component analysis was performed on parallel equivalent capacitance, quality factor, parallel equivalent resistance, complex impedance, parallel equivalent inductance, and phase angle.
At the measurement frequencies of 10 kHz and 100 kHz, the characteristic values of the first two principal components were both greater than 1 (Figure 3a), and the variance cumulative contribution rate of the first two principal components exceeded 91% (Figure 3b).
The more information the principal component retained about the original variable, the larger the load value [39]. The absolute values of the characteristic load of the first principal component (PC1) and the second principal component (PC2) were similar in Table 4, indicating that PC1 and PC2 represented the information of various electrical parameters in a balanced manner [32], and the first two principal components could be used as characteristic parameters to establish classification models. between electrical parameters.

Principal Component Analysis
Principal component analysis was performed on parallel equivalent capacitance, quality factor, parallel equivalent resistance, complex impedance, parallel equivalent inductance, and phase angle.
At the measurement frequencies of 10 kHz and 100 kHz, the characteristic values of the first two principal components were both greater than 1 (Figure 3a), and the variance cumulative contribution rate of the first two principal components exceeded 91% ( Figure  3b).  Table 4, indicating that PC1 and PC2 represented the information of various electrical parameters in a balanced manner [32], and the first two principal components could be used as characteristic parameters to establish classification models.

Modeling and Model Validation
Classification models were established using NB, KNN, and SVM to classify the inner injury and normal fragrant pears using the quality factor, parallel equivalent resistance, phase angle, and the first two principal components as characteristic parameters at three measurement frequencies. To improve the prediction performance of the models, especially the performance of the trained models on new data, 10-fold cross-validation was used to reduce the possibility of overfitting. The aim of 10-fold cross-validation was to divide the training dataset into 10 parts, taking turns to train 9 parts of them and validate 1 part of them. The average of the 10 results was used as an estimate of the algorithm's accuracy. All the training data were involved in modeling, which could well estimate the training accuracy of the models [40].
The performance of the NB, SVM, and KNN classification models for recognition was assessed using accuracy, precision, recall, and F 1 score. In actual production, the loss caused by inner-injury pears during storage is immeasurable. All of the inner-injury pears are expected to be identified correctly, so the effect of recall is more important.
The quality factor, parallel equivalent resistance, and phase angle were used as the characteristic electrical parameters at the three measurement frequencies for the classification models. The recognition accuracy of the SVM and KNN discrimination models was superior to that of the NB model. This may be because NB is founded on the assumption that the feature parameters are independent of one another and that the redundant attributes of the feature electrical parameters will lower the prediction performance [41]. The classification models established at 10 kHz and 100 kHz were better than those of the models established at 1 MHz to identify the inner-injury pears. The SVM model, when evaluated with the confusion matrix, precision, and recall, had the best classification effect at 100 kHz, correctly identifying 19 of 25 normal pears and 73 of 75 inner-injury pears (Table 5); the recognition accuracy was 92.00%, the precision was 92.41%, the recall was 97.33%, and the F 1 score was 0.95 (Figure 4a).

Modeling and Model Validation
Classification models were established using NB, KNN, and SVM to classify the inner injury and normal fragrant pears using the quality factor, parallel equivalent resistance, phase angle, and the first two principal components as characteristic parameters at three measurement frequencies. To improve the prediction performance of the models, especially the performance of the trained models on new data, 10-fold cross-validation was used to reduce the possibility of overfitting. The aim of 10-fold cross-validation was to divide the training dataset into 10 parts, taking turns to train 9 parts of them and validate 1 part of them. The average of the 10 results was used as an estimate of the algorithm's accuracy. All the training data were involved in modeling, which could well estimate the training accuracy of the models [40].
The performance of the NB, SVM, and KNN classification models for recognition was assessed using accuracy, precision, recall, and F1 score. In actual production, the loss caused by inner-injury pears during storage is immeasurable. All of the inner-injury pears are expected to be identified correctly, so the effect of recall is more important.
The quality factor, parallel equivalent resistance, and phase angle were used as the characteristic electrical parameters at the three measurement frequencies for the classification models. The recognition accuracy of the SVM and KNN discrimination models was superior to that of the NB model. This may be because NB is founded on the assumption that the feature parameters are independent of one another and that the redundant attributes of the feature electrical parameters will lower the prediction performance [41]. The classification models established at 10 kHz and 100 kHz were better than those of the models established at 1 MHz to identify the inner-injury pears. The SVM model, when evaluated with the confusion matrix, precision, and recall, had the best classification effect at 100 kHz, correctly identifying 19 of 25 normal pears and 73 of 75 inner-injury pears ( Table 5); the recognition accuracy was 92.00%, the precision was 92.41%, the recall was 97.33%, and the F1 score was 0.95 (Figure 4a).   (a) Quality factor, parallel equivalent resistance, and phase angle as the input parameters; (b) The first two principal components as the input parameters.
The first two principal components were used as characteristic parameters to establish classification models. The recognition accuracies of SVM classification models were superior to those of NB and KNN models at the three measurement frequencies, and the effectiveness of discriminant models established at 10 kHz and 100 kHz was superior to that established at 1 MHz in identifying the inner-injury pears. When the measurement frequencies were 10 kHz and 100 kHz, the recognition accuracy was 90.00% ( Table 6). The SVM discriminant model correctly identified 70 of 75 inner-injury pears at the measurement frequency of 10 kHz, and the precision and recall were both 93.33% (Figure 4b). Under 100 kHz, the SVM discriminant model correctly identified 72 of 75 inner-injury pears (Table 6), with a precision of 91.14%, a recall of 96.00%, and an F 1 score of 0.94 (Figure 4b).
Taking into account the confusion matrix, precision, recall, and F 1 score, the SVM model established with the measurement frequency of 100 kHz had the best discriminant effect when the first two principal components were used as the characteristic parameters. When the measurement frequency was set to 100 kHz, the quality factor, parallel equivalent resistance, and phase angle were used as input parameters, and the constructed SVM classification model produced the best discrimination result for identifying the inner injury of fragrant pears. The quality factor, parallel equivalent resistance, and phase angle are three recommended electrical metrics for identifying inner-injury pears.

Conclusions
In this study, electrical parameters were used to detect the inner injury of the Korla fragrant pear. The parallel equivalent capacitance, quality factor, parallel equivalent inductance, parallel equivalent resistance, impedance, and phase angle of the inner-injury fragrant pears and normal pear samples were measured at three measurement frequencies.
The electrical parameters of the inner-injury fragrant pear and normal fragrant pear were different. They have the potential to detect inner-injury fragrant pear. The quality factor, phase angle, and parallel equivalent resistance had significant correlations with the inner injury of fragrant pears and were used as characteristic parameters to identify the inner injury. The classification model was created using the quality factor, phase angle, and parallel equivalent resistance as typical electrical parameters, and better categorization results were achieved. With the preferred frequency of 100 kHz, the SVM model had a recognition accuracy of 92.00%, a precision of 92.41%, a recall of 97.33%, and an F 1 score was 0.95. It was clear that it was feasible to identify the inner injury of fragrant pear with electrical parameters. This study could provide a reference for the development of an online injury recognition system based on electrical parameters.