Introduction

Peaches (Prunus persica (L.) Batsch) are very nutritious fruit consumed all over the world in fresh, processed and dried forms. Peaches are characterized by anti-cancer, anti-tumor, anti-allergic, anti-microbial and anti-inflammatory properties. Due to the presence of lignified endocarp (stone) with seed, peaches are called “stone fruit”. Peaches include also an exocarp and a fleshy mesocarp [1]. The peach flesh is the most valuable agro-industrial part of the fruit [2]. The peaches with a melting fruit are common consumed in fresh form and fruits with non-melting flesh may be subjected to processing [3]. However, the stones may be also a valuable by-product [4]. Peach included several thousand cultivars. Due to low genetic variability and a narrow genetic base, some peach cultivars, mainly from the same parents, may be genetically and morphologically similar [5]. The establishment of the cultivated peach crops involved domestication and cultivar differentiation of peach. Nowadays, peach cultivars may be divided into fruit cultivars and flower-ornamental cultivars [6]. In the market, there are numerous peach cultivars including newly released ones. Peach cultivars were selected by breeders mainly due to external features of fruit including appearance and size, but also nutritional and organoleptic properties that are very important for consumers [7]. The new peach cultivars with high-quality fruit are constantly in demand [8]. New cultivars with increasing sensory quality are developed by breeders to increase their acceptability. Sensory tests are common applied for the evaluation of new cultivars, new storage practices and support breeding. Sensory tests enable product comparison, prediction of consumer acceptance and shelf-life monitoring [3]. Peaches are very dynamic tree fruit and new cultivars may be released every year. The peach cultivars may be characterized by different physical properties of the fruit. During breeding, flesh color and texture or shape may be genetically controlled. Others, such as mass, size, and sugar content, are mainly affected by seasonal and environmental factors. Due to the differentiation in properties of peaches belonging to different cultivars, cultivar discrimination may be essential for the peach industry for maintaining cultivar homogeneity to ensure adequate processing conditions and equipment parameters. The physical properties can affect the efficiency of processing and may be important, for example, for sorting, peeling and pitting of peaches [9]. Identification of fruit properties and cultivar discrimination may facilitate these processes [9]. Inspection, evaluation of quality and sorting of fruit in the food industry may be supported by computer vision in a rapid, objective, economic and consistent manner [10]. Classification and sorting with the use of machine vision can be advantageous than conventional mechanical or optical sorting devices for the reduction of time and higher accuracy of results [11]. However, morphological identification of closely related peach cultivars may be difficult. The molecular markers may be applied as an alternative for the discrimination of peach cultivars [5]. Human inspection of fruit quality may be subjective and result in fatigue or distractions of inspectors that may affect the results [12]. The appearance screening of fruit by human operators may be characterized by large errors and low efficiency. Furthermore, commonly used methods allowing for the detection of the chemical and physical quality of fruit may be time-consuming or require special equipment [13]. Therefore, objective, rapid and relatively inexpensive techniques should be constantly improved.

The aim of this study was to evaluate the usefulness of individual parts of fruit for cultivar discrimination of peaches based on textures determined using image analysis. The textures of the outer surface of images were calculated for the skin, flesh, stone and seed of the fruit.

Materials and methods

Materials

The peaches ‘Royal Glory’ and ‘Redhaven’ were sampled from the Experimental Orchard of the National Institute of Horticultural Research, Skierniewice, Poland. The peaches were harvested at optimum maturity stage for storage (not fully ripe). To eliminate the influence of environmental and seasonal factors on the properties of peaches, samples were collected in the same region and season.

The whole peaches, slices of flesh, stones and seeds were subjected to experiment. The slices of peaches were obtained by cutting fruit with a knife. The stones were manually removed from peaches and were cleaned of flesh. After acquiring images of stones, the seeds were extracted from stones. Exemplary images of whole peaches, slices, stones and seeds of peaches ‘Royal Glory’ and ‘Redhaven’ are presented in Fig. 1.

Fig. 1
figure 1

Exemplary images of whole fruit, slice, stone and seed of peaches ‘Royal Glory’ and ‘Redhaven’

Image analysis

Image analysis was carried out with the use of images obtained using the digital camera. For each cultivar, 100 images of each part of fruit were obtained. The images were acquired against a black background in the black box using LED illumination. In the first stage, the whole peaches were subjected to analysis. In the case of each fruit, images from two sides of the outer lateral surface were acquired. For each peach, two slices were obtained from the flesh of both sides of the stone. Before obtaining images, excess juice was removed from the slices. The images of stones and seeds were acquired on the dorsal and ventral sides. The images of whole fruit, slices of flesh, stones and seeds of peaches were analyzed using the Mazda software (Łódź University of Technology, Institute of Electronics, Poland) [14]. The images were converted to color channels R, G, B, L, a, b, X, Y, Z. In the case of each image in each color channel, the regions of interest (ROIs) were determined. The individual ROIs included: the image of the skin of a peach, a slice of flesh without skin, stone, and seed. About 200 textures were calculated for one ROI in each color channel.

Statistical analysis

Statistical analysis included the discriminant analysis performed with the use of the WEKA 3.9 application (Machine Learning Group, University of Waikato) [15]. The cultivar discrimination of peaches ‘Royal Glory’ and ‘Redhaven’ based on selected textures of the outer surface of images of skin of peaches, slices of flesh without skin, stones and seeds were carried out. The attribute (texture) selection was performed using the best first with the CFS (correlation-based feature selection algorithm) subset evaluator. The textures with the highest discriminative power were chosen. The first step of discriminant analysis included building the discriminative models based on a set of combined textures selected from all color channels R, G, B, L, a, b, X, Y, Z. The models were built separately for skin, slices, stones and seeds of peaches ‘Royal Glory’ and ‘Redhaven’. In the following step, the discriminative models were built for textures selected separately for RGB, Lab and XYZ color spaces. The analyses were performed using a tenfold cross-validation mode. The classifiers of Bayes Net (from Bayes group), logistic (functions), SMO (functions), multi-class classifier (meta) and random forest (trees) were applied [16]. These classifiers were chosen as providing the highest discrimination accuracies. The criterion for the evaluation of the analysis was the average accuracy (%) of cultivar discrimination of peaches ‘Royal Glory’ and ‘Redhaven’. The results obtained for skin, flesh, stones and seeds were compared to select the most useful part of peach for identification of cultivar.

Results and discussion

The average accuracies of discrimination of peaches ‘Royal Glory’ and ‘Redhaven’ performed using sets of combined textures selected from all color channels (R, G, B, L, a, b, X, Y, Z) are presented in Table 1. The discriminative models built for textures of the outer surface of images of flesh, stones and seeds produced 100% correctness for selected classifiers (Bayes Net, logistic, SMO and multi-class classifier in the case of seeds; Bayes Net, SMO and random forest for flesh; Bayes Net for stones). These results revealed that based on the textures selected from color channels R, G, B, L, a, b, X, Y, Z of flesh, stones and seeds images, a complete distinction of peach cultivars is possible. In the case of discriminant analysis carried out based on selected textures of the skin of peaches, the highest accuracy was equal to 99% and was obtained for the Bayes Net classifier. For applied classifiers, the lowest accuracy of 93% was observed for skin and the Random Forest classifier. The lowest accuracy for discrimination based on textures of flesh and stone was equal to 97% and for seeds was 98%. These results are also very high and satisfactory.

Table 1 The accuracy of cultivar discrimination of peaches ‘Royal Glory’ and ‘Redhaven’ based on sets of skin, flesh, stones and seeds textures selected from all color channels (R, G, B, L, a, b, X, Y, Z)

In the next steps, discriminant analyses were performed using models built for textures selected from individual color spaces. For the sets of textures selected from RGB color space (Table 2), only flesh and seeds of peaches ‘Royal Glory’ and ‘Redhaven’ were discriminated in 100% for the Bayes Net classifier. The discriminative model built for skin provided accuracy in the range of 95–99%, and the highest result (99%) was reached in the case of the Bayes Net classifier. In the case of textures selected from the RGB color space of stone images, the correctness ranged from 94 to 97% (logistic, multi-class classifier, random forest). The differences in values of exemplary texture RHMean of skin, flesh, stones and seeds of peaches ‘Royal Glory’ and ‘Redhaven’ are presented in Fig. 2.

Table 2 The accuracy of cultivar discrimination of peaches ‘Royal Glory’ and ‘Redhaven’ based on sets of skin, flesh, stones and seeds textures selected from RGB color space
Fig. 2
figure 2

The values of texture RHMean of a skin, b flesh, c stones, d seeds of peaches ‘Royal Glory’ and ‘Redhaven’; SEM standard error of the mean

In the case of Lab color space (Table 3), slightly lower accuracies than for RGB color space were obtained. Only in the case of seeds ‘Royal Glory’ and ‘Redhaven’, the cultivar discrimination accuracy reached 100% (Logistic, and Multi Class Classifier). The accuracies for the model including the textures selected from Lab color space of images of slices of flesh were equal to 97–99% with the highest results for the Bayes Net and SMO classifiers. The peach ‘Royal Glory’ and ‘Redhaven’ were discriminated in 93–98% (Bayes Net, logistic, multi-class classifier) based on skin textures. The discriminative models built based on textures selected from Lab color space of stone images provided the correctness of 94–97% for Bayes Net, SMO and random forest classifiers.

Table 3 The accuracy of cultivar discrimination of peaches ‘Royal Glory’ and ‘Redhaven’ based on sets of skin, flesh, stones and seeds textures selected from Lab color space

The cultivar discrimination of peaches ‘Royal Glory’ and ‘Redhaven’ performed for textures selected from XYZ color space (Table 4) revealed the accuracy of 100% only for seeds for the logistic classifier. The very satisfactory results reaching 99% (SMO, and Random Forest) were observed for discriminant analysis of flesh. The discriminative models built for skin provided accuracies in the range of 87–95% (Random Forest). Stones of two cultivars of peach ‘Royal Glory’ and ‘Redhaven’ were discriminated with accuracies of 91–95% (Bayes Net).

Table 4 The accuracy of cultivar discrimination of peaches ‘Royal Glory’ and ‘Redhaven’ based on sets of skin, flesh, stones and seeds textures selected from XYZ color space

The results of the research revealed that the selected parts of fruit may allow for discrimination of peach cultivars with 100% correctness, and it can be possible using rapid, objective and inexpensive image analysis technique based on texture parameters of acquired images. In the available literature, there is insufficient information on comprehensive research on cultivar discrimination of peaches with the use of image analysis using individual parts of fruit, including skin, flesh, stone and seed. There is also a scarcity of research on the use of textures of images for cultivar identification of peach. Therefore, own research is a significant extension of the existing knowledge on the discrimination of peach cultivars that was performed based on the physical, chemical or genetic properties.

According to Alipasandi et al. [11], three cultivars of peach were classified based on the color of the external surface and shape features of the fruit using image processing combined with the artificial neural network with high total accuracy reaching 99%. Image analysis was also applied by Peri et al. [17] for discrimination of peaches in terms of firmness (soft, firm), which is correlated to color. The accuracies of discrimination depended on the peach cultivar (65–93%) that was related to the percent of “blush” on the peach surface. Results obtained by Li et al. [9] revealed that selected physical properties, such as geometric parameters of peach fruit may be used in cultivar discrimination and the quantitative evaluation of peach properties and cultivar discrimination may be used in processing and equipment design to increase in processed peach quality and enhance the efficiency of the process. The accuracy of 100% was obtained for the discrimination of three cultivars of peach based on reflectance spectra (Vis/near-infrared reflectance spectroscopy) combined with PCA-BPNN [18]. Different cultivars of peach were also identified using the volatile components by Montero-Prado et al. [19]. The authors [19] reported that determination of the origin of fruit (its cultivar) is possible due to the identification of an unequivocal feature discriminating one cultivar from others and physical or visual properties may be insufficient. The differences in volatile compounds of individual cultivars may allow to discriminate the peach cultivar, avoid fraud and deceptive marketing of cultivars with lower quality that could have economic implications. Also, Infante et al. [20] determined that the peach cultivars may be discriminated using the volatiles and the distinguish of cultivars based on the aromatic features is possible by the application of the e-nose. The electronic nose combined with the artificial neural networks was also applied by Parpinello et al. [21] for the classification of apricot cultivars. According to Zhang et al. [22], phenolic phytochemicals can be used as markers for the discrimination of peach cultivars. Also, Nowicka et al. [23] reported that the cultivar determines the chemical composition, as well as the nutritional value of peaches. Rojas et al. [24] and Sitther et al. [25] reported that simple sequence repeat (SSR) markers may be successfully used for cultivar identification of peach. However, some of the commonly used methods or techniques for peach cultivar discrimination can require more specific equipment, longer time or higher costs than image analysis. Even promising technique as VIS/NIR for cultivar identification [26] requires a build a large database for precise models [27]. Furthermore, the quality parameters of peaches changed during storage and ripening. Significant reduction of fruit firmness and acidity are observed. Also, the emission of volatile organic compounds depends on the ripening stage, storage conditions [28, 29]. Therefore, studies to develop simple, fast techniques using physical features of fruit are still necessary.

Phenotypic features of peaches may be the result of the impact of environments in addition to genotypes. Different genotypes may be characterized by different performances in various environments. Environmental influences may result in differences between genotypes that may vary from year to year. The adaptability of fruit and stability of production in different years and locations may be crucial for agricultural production [8]. Therefore, it seems advisable to extend the research on cultivar discrimination of peaches by examining samples from different locations and different seasons. Additionally, more cultivars should be included in the studies to confirm the usefulness of the developed procedures for distinguishing peach cultivars. The present study provided guidance on the part of the fruit and sets of textures most suitable for this type of research and further research should be based on the obtained results. The presented method seems to be promising for cultivar differentiation, regardless of fruit ripening stage.

Conclusions

The obtained results proved that the peach cultivars may be successfully discriminated with an accuracy of 100% using image analysis based on selected texture parameters of fruit flesh, stones and seeds. However, the complete differentiation of two cultivars for these parts of fruit (flesh, stone, seed) was observed only in the case of sets of combined textures selected from color channels R, G, B, L, a, b, X, Y, Z. The most satisfactory results were obtained for seeds, for which two peach cultivars were correctly discriminated in 100% also in the case of models built separately for individual color spaces RGB, Lab and XYZ. For discriminant analysis based on textures of skin, the full discrimination was not determined and the highest accuracy of 99% was found for models built for a set of textures selected from all color channels (R, G, B, L, a, b, X, Y, Z) and set of textures selected from RGB color space.