# Disease and Defect Detection System for Raspberries Based on Convolutional Neural Networks
## 1 Introduction  
Raspberries (_Rubusidae_ L.), as with other berries, are fruit of great importance for human beings since they are a fundamental part of healthy nutrition and powerful allies for human health; they are also good sources of nutrients and antioxidant phytochemicals that contribute to the prevention of chronic diseases [1, 2, 3]. Even the wastes produced from raspberry processing in the industry are rich in bioactive compounds, whose enhanced downstream production processes have the potential to be used in the food and pharmaceutical industries, generating economic and environmental benefits [4, 5]. According to the Food and Agriculture Organization of the United Nations (FAO) [6], the world production of raspberries is more than 800,000 tons, of which almost 98% is split between Europe and the Americas, as shown in Figure 1.  
Berry production is of great importance in different regions of Chile. According to the Fruit Bulletin of June 2021 published by the Chilean Office of Agricultural Studies and Policies, during the period January-May 2021, a total of 1.74 million tons of fruit exports was registered [7]. The raspberry is the second most important berry in Chile, which currently ranks tenth in terms of raspberry production worldwide [6]. The market for raspberry products is segmented by quality standards. Fruit with the highest quality is destined for export as fresh fruit, medium quality is destined for frozen fruit, and low quality is used in the production of juice and jams. This quality assessment defines the price of raspberries for both producers and exporters. Currently, in the agro-industries, estimating raspberry quality is a manual process, carried out by specialized personnel at the reception areaof the fruit processing plant, as shown in Figure 2, this inspection takes between 5 and 10 min for each harvesting tray. Raspberries arrive at the fruit processing plant in harvesting trays. The procedure is as follows: (i) a random sample is taken from the batch of raspberries (harvesting trays) that arrive at the fruit processing plant; then (ii) specialized personnel at the reception area carry out an inspection, visually separating and counting the raspberries that present defects or diseases; and (iii) the quality of the lot is defined according to parameters pre-set by the food industry. Some critical defects or diseases to consider are fungus-rust, albinism, overripeness, and peduncle attached to the fruit. The visual inspection process that is carried out has several drawbacks, such as being subjective because it depends on the criteria of the expert present at the time, prone to errors and not representative, since it usually considers a very limited sample of raspberry trays per lot due to the slow measurement process. In addition, errors in the estimation  
Figure 1: Production share of raspberries by region [6]. Figure 2: Manual quality measurement of raspberries in a harvesting tray. of quality imply economic losses for both the producer and the exporter. Therefore, it is proposed to resolve this problem, which consists of estimating or measuring the quality of raspberries in harvesting trays, directly and automatically without the intervention of a human expert. The development and application of non-destructive methods to streamline and automate the quality criteria of fruit for human consumption is of great interest [8]. Therefore, non-destructive testing is considered one of the fastest and most efficient tests that do not affect the appearance and quality of fruit by analyzing them [9]. In this sense, Computer Vision Systems (CVS) are very useful for non-destructive testing. CVSs are being widely used in agribusiness for quality control in the fruit packing process. CVSs are generally made up of a controlled lighting environment, a sensor or camera to acquire images, and a computer containing the algorithms for image processing.