# Semantic Segmentation of Packaged and Unpackaged Fresh-Cut Apples Using Deep Learning
## 1 Introduction
Watershed segmentation (WS) and circular Hough transform (CHT) algorithms were used for pixel-wise fruit segmentation and to detect and count the individual fruits. CNN provided the best segmentation with a F1-score of 0.791. CNN also achieved best detection with a F1-score of 0.861 using WS detection. [PERSON] et al. proposed a methodology to perform instance segmentation of strawberries using a fully convolutional neural network [26]. Their methodology produced an improvement in precision and processing time as compared with the previously used Mask R-CNN models and put forward their use in real-time automatic strawberry harvesting systems. Most CVSs, for fruit grading or defect detection or separation of fruits from background, process images by working on the peel. Looking only at the peel would not provide all the information about physicochemical properties. Colour could be more informative about maturity and internal properties especially if evaluated on internal parts of fruits [7]. The browning of the pulp plays an important role in the evaluation of the internal quality of fruits especially in fresh-cut products, where the cutting handlings cause the rapid browning of the cut surfaces. The intensity of the browning on the pulp in fresh-cut apples is an objective parameter of the shelf-life loss. Higher browning of the pulp indicates a lower visual quality of apple slices (higher shelf-life loss). So, the possibility of identifying the browning only on the pulp of apple slices could be an accurate and consistent way to monitor the shelf-life of this kind of product. Furthermore, the ripening and evaluation of TSS cannot be estimated accurately by relying only on the peel. However, a high-quality precision can be attained by considering the pulp as well since it provides additional useful hints about internal defects and other physicochemical properties. Therefore, it becomes critical to operate a robust and effective separation of the peel and pulp since the visual similarity between the pulp and peel can make this segmentation task difficult for approaches that rely only on colour. There is only one research work conducted on the browning of fresh-cut apples that is also by a traditional image analysis. [PERSON] et al. performed an image analysis to detect browning in fresh-cut apples using colour and texture features [27]. They developed a CVS for image acquisition of three varieties of apple and measured the colour distance over the time by transforming the colour space from RGB to \(L^{\bullet}u^{\bullet}\)* values. They manually extracted the parts of interest in each image and rely on the scene to be static while the browning process goes on. A more realistic application context must rely on an automatic selection of the regions of interest in each image. Our approach focuses its attention to the pulp that is significantly affected by the browning process. We expect a colour analysis based only on it to provide more robust and effective results. Thus, a robust and powerful segmentation technique to separate the peel and pulp of fresh-cut apples is a promising area and very much useful for the continuous monitoring of the browning process of apples from harvest to consumers. The possibility of applying the same methodology also on packaged products with similar performances is a powerful improvement in CVS applications. In case of packaging products, a high level of quality in terms of appearance, sensorial, and nutritional characteristics is required. Additionally, the increasing consumers' need to assess the real quality level inside the packaging is another important aspect to consider. A relevant challenge to face in ensuring a correct quality assessment through the packaging material by CVS is the separation of opaque and affected regions of bags from the transparent area where the product is visible with acceptable fidelity of visual appearance. This separation step requires robust and powerful segmentation approaches.