The results of the study proved the usefulness of machine learning for discrimination of different sweet cherry cultivars based on texture and geometric parameters of the endocarp. The research revealed that some cultivars may be completely different in the terms of endocarp characteristics and the determined discriminative models may allow to classify the endocarp with total accuracy of up to 100%. The feature set, both selecting specific textures and their number may prove to be crucial for the correctness of the discrimination of endocarp of different sweet cherry cultivars. It was observed that the larger the initial data set, the more features are selected. Almost 200 texture features were determined for one endocarp in each color channel. So, in the case of discrimination based on sets of textures selected from all color channels (
R,
G,
B,
L,
a,
b,
X,
Y,
Z), initially about 1800 textures were subjected to a selection. For each color space, initially were about 600 textures. In the case of textures from all color channels, about 50 features were selected, for each color space about 20–30 features were chosen and for each color channel, only 10–20 textures were selected. However, the accuracies were the highest for discriminative models built based on sets of textures selected from all color channels (
R,
G,
B,
L,
a,
b,
X,
Y,
Z) and the lowest in the case of individual channels. For geometric features, several to over a dozen parameters were selected. Furthermore, research to include textures selected from other channels, such as V, H, S, I, U in the discriminative models were carried out. However, a set combining textures from color channels (
R,
G,
B,
L,
a,
b,
X,
Y,
Z) provided the highest accuracy. Therefore, the other results were not included in this paper. Considering the results obtained using individual classifiers, the Multi Class Classifier and LMT provided the highest accuracies and these classifiers are recommended for cultivar discrimination of sweet cherry endocarp. The obtained results reaching 100% are very high compared with literature data. Depypere et al. [
9] investigated the usefulness of the dimensions and shape of
Prunus (
P. domestica,
P. insititia,
P. x fruticans,
P. spinosa,
P. cerasifera) endocarps. The authors found that the following endocarp characteristics: ‘Perimeter’, ‘Triangle’, ‘Area’, ‘Ellipse’, ‘Circular’, ‘Rectangular’ and some index values may be very appropriate for taxonomic analysis. The values of parameters can be changed depending on endocarp maturity and levels of hydration. Frigau et al. [
10] used size, shape, and texture parameters determined by image analysis for the discrimination of the
Prunus sp. seeds fo different plum cultivars (
Prunus salicina,
Prunus domestica,
Prunus cerasifera). The classification accuracy reached 0.9067 was observed for set combining textures, size and shape parameters. In the case of data set including only textures, the accuracy of up to 0.7730 was observed. For size parameters, the accuracy was equal up to 0.5732, and for shape features–up to 0.4390 [
10]. Sarigu et al. [
20] observed high accuracies of cultivars discrimination of plum endocarps based on morpho-colorimetric (shape, size, surface color) and texture parameters determined using an image analysis technique. The overall accuracy of 86.1% was obtained for distinguishing endocarps of different
P. domestica cultivars. Discrimination between
P. domestica and
P. spinosa provided the accuracy of 99.3%. Thereby, Sarigu et al. [
20] proved the usefulness of image processing in taxonomic studies, including the cultivar level. The developed procedures might be applied in germplasm banks, nurseries or other institutions for the conservation of biodiversity and enhancement of traditional plum cultivar for consumer satisfaction. Beyaz and Öztürk [
21] successfully applied stone image analysis based on geometric parameters, such as length and width for the classification of olive cultivars. Stone characteristics were also applied by Milatović et al. [
22] for the identification of apricot (
Prunus armeniaca) cultivars. The authors found that the size, shape, participation of stone in fruit mass were the most significant in apricot cultivar discrimination. In the case of jujube, stone shape, length, width and weight were useful for discrimination between different cultivars [
23]. Furthermore, stone (endocarp) dimensions, such as, for example, length, width, and suture diameter can be used in archaeological studies in terms of cultivation and domestication fruit [
24].
Own research has significantly expanded the scope of application of machine learning for sweet cherry research. Approximately 60 geometric parameters and about 200 textures for images from each color channel were calculated for one endocarp. Discrimination of sweet cherry endocarp based on features selected from such a large set is a great novelty of the performed research. The developed models for the cultivar discrimination, extended in the future with more detailed research of sweet cherry pits and even other species of fruit, can be extremely useful in industries, mainly in the food industry, the production of biodiesel and the cosmetic industry. Further research may include more cultivars. Additionally, a more detailed explanation of the relationship between the appearance of endocarp and fruit is needed. For different cultivars, the discrimination accuracy of the fruit with the accuracy of the discrimination of endocarp may be compared using the discriminative models built based on selected textures and geometric parameters. The relationship between texture or geometric features and chemical composition may be investigated. The usefulness of the obtained results and the need for further research are confirmed by the literature data on the valuation of sweet cherry pits and differentiation of properties depending on the cultivar. Due to the increase in cherry production and fruit processing, among others, for juice, jelly, or jam, there are also large amounts of pits that can be used. There are many compounds relevant to humans, the content of which varies with the cultivar. Some compounds may have a positive effect on human health Therefore, the cultivars with a high content of these compounds may be desirable for the food industry. Different cultivars of sweet cherry kernels may be characterized by different antioxidant activity and bioactive content including β-Carotene, total flavonoid, total phenolic, saponins [
25]. Aqil et al. [
7] confirmed that the final food products obtained from sweet cherry kernels of different cultivars may have different properties. Aqil et al. [
7] reported that an active ingredient included in sweet cherry kernel oil can be used in the food and cosmetic industries. Sweet cherry kernel oil may be characterized by different fatty acids and sterols composition, tocopherol content, depending on cultivars. Different cultivars may also differ in the oil yield. Therefore, the identification of cultivars of pits including kernels used in processing is important. Due to the risk of adulteration, methods or techniques to distinguish between sweet cherry pit cultivars can be used in processing plants, sorting lines or even during the purchase of pits. Image analysis is objective and may contribute to increase the correctness of classification and reduce costs, time and labor consumption of analyzes. The procedures developed in the present study may prove crucial to cultivar identification of sweet cherry pits and can also be adapted to other fruit including endocarp (pit or stone). The usefulness of image analysis based on texture parameters was also confirmed for cultivar discrimination of sour cherry pits [
26]. Therefore, the results of this study have great potential and practical applications and research should be expanded and continued for different species of fruit.