# Semantic Segmentation of Packaged and Unpackaged Fresh-Cut Apples Using Deep Learning
## 1 Introduction
However, their accuracy for the stem ends inside the apples was only 81%. They justified this lower accuracy by pointing out the similarity between colour and position of the stem end inside the apple and shadow or defects. [PERSON] et al. came up with a machine vision system based on RGB images for tomato grading [18]. Their system segmented calyx and stalk scars in both defected and healthy tomatoes with an average accuracy of 0.9515 using histogram thresholding based on the mean g-r value of the regions of interest. Since defected calyx and stalk scars appeared to have similar colour intensities at different levels of ambient light, they achieved a lower accuracy on defected tomatoes. [PERSON] et al. automatically distinguished stem and calyx ends and detected damaged berries using a pattern recognition method [19]. They implemented image segmentation in two steps [19]. In the first one, the original images were cropped to a pre-defined dimension to isolate single berries. The second step involved a threshold-based segmentation of the colour images refined by morphological operations. The resulting binary mask separated the fruit from the background. [PERSON] et al. developed a sliding window local segmentation algorithm for the detection of surface defects on oranges [20]. This method was able to detect various types of surface defects and to separate them without any additional image lightness correction process. They achieved an accuracy of 93.8% for the classification of stem ends from defective and sound orange peels. They obtained an accuracy of 91.9% in the segmentation of individual defects and a 97% performance rate for defective orange detection. [PERSON] et al. introduced an automatic non-intrusive computer vision system for the estimation of the pH value of oranges [21]. They performed experiments on three varieties of oranges: Bam, Blood, and Thomson. They used a 2-step segmentation process for the extraction of features to estimate the pH value. A threshold based on the first component of RGB colour space was applied in the first stage to remove the background before converting the image into a binary representation. A closing filter was used in the second segmentation stage to refine the mask. [PERSON] et al. proposed a method to identify pomergnate fruits inside colour images taken by digital camera under natural light conditions [22]. The segmentation was based on colour and spatial features using a k-means clustering algorithm. Image retrieval was possible after merging the clustered blocks to a specific number of regions. Recently, deep learning techniques have proved to be a powerful tool to improve the accuracy of semantic image segmentation. The convolutional neural networks have expressed a significant impact in these tasks [14; 23]. [PERSON] et al. investigated a deep learning network for the segmentation of grape bunches in colour images [24]. Their comparative study used two segmentation metrics, (1) segmentation accuracy and (2) Intersection over Union (IoU), to evaluate the performance of four different pre-trained network architectures, specifically AlexNet, GoogLeNet, VGG16, and VGG19. They also proposed an optimal threshold selection of bunch probability maps to improve the segmentation of pixels. Their strategy improved the mean segmentation accuracy of the aforementioned four deep neural networks in a range from 2.10% to 8.04%. They reported the VGG19 to achieve the best performance with an accuracy of 80.58% and an IoU of 45.64% on the bunch class. The GoogLeNet produced the worst performance with a mean segmentation accuracy of 74.41% and IoU of 37.13%. [PERSON] and [PERSON] introduced an image processing framework for fruit detection and counting using apple orchard image data [25]. General-purpose feature learning algorithms were utilized for image segmentation. The image segmentation was done using multiscale multi-layered perceptron (ms-MLP) and convolutional neural networks (CNN).