# Promotion of Color Sorting in Industrial Systems Using a Deep Learning Algorithm
## 1 Introduction  
Since digitalization of agriculture contributes to increased efficiency in primary production processes [1, 2, 3], current technologies in industrial processing systems demand innovation. Serbia is one of the three greatest raspberry producers in the world; therefore, any loss during processing is a global-level loss. Raspberry fruit can be frozen, sorted, and processed as whole, whole and broken, crumbled, or used as raw material for puree production. As for the cold processing of raspberry, the requirements for machine inspection concerning extra class are as follows: the fruits must be whole, clean, fresh, and seemingly healthy, without any defects and foreign materials. In addition, they must be uniform in maturity level and firm enough to withstand handling and transport. Certain deviations, up to 5%, are permissible. For premium-class raspberries, some deviations are tolerated regarding fruit development and size (up to 10%); however, fruits must not be over-ripe. Industrial systems for machine inspection of agricultural products are mostly standardized. Each machine has its control system and algorithm to define the criteria and perform the selection of products. Output accuracy of the color sorter ranges commonly from 91 to 98%. One operator services the machine and generates recipes for each product being processed separately. When generating a recipe, a certain amount of product is allowed to pass through the machine, screened with available optical devices. In general, the external quality of fruits and vegetables is assessed using the physical characteristicsof color, texture, size, shape, and visual defects [4; 5; 6]. The operator obtains the output parameters that refer, for the most part, to the color and shape. On the basis of differences in parameter values for compliant and noncompliant products, critical criteria and their values are selected and adjusted, i.e., a recipeis generated. Noncompliant products are products whose physical characteristics do not conform to the Class Specification Regulations, or that contain foreign materials found during sorting, such as soil, wood, plastics, glass, metal, leaves, animal and insect parts, etc. The promotion of machine vision was contributed to mostly by deep learning algorithms. During the investigation of the latest research in the machine vision field, convolutional neural networks seemed to be the best approach for resolving some of the aforementioned issues during color sorting. On the other hand, with many training images, algorithms can learn quickly and, after some time, the efficiency and accuracy of overall human capabilities may be calculated. Although there are no scientific papers directly related to the application of machine and deep learning on machines for color sorting and inspection in industrial production, a considerable number of research studies indicate the potential for inspection and assessment of fruits [7; 8; 9], vegetables, the quality of cereals [10; 11], legumes, detection of bruises and diseases [12; 13], and in primary agricultural production [14; 15; 16; 17]. Initial investigations of the YOLO (you only look once) [18] algorithm implementation, as a widely used algorithm that can operate in real time, were related to autonomous vehicles and detection of objects and pedestrians [19; 20] or insect classification [21]. Very soon, these algorithms were applied in other areas [22; 23; 24; 25], including in fruit and vegetable recognition [26; 27]. The closest comparison to our research is found in [28]. Here, the authors designed databases of raspberry images which are ready for industrial inspection. The focus of this paper is evaluating the largest amount of fruit possible and not a single sample. Therefore, the difference from our dataset is that our data come directly from the machine referred to as the color sorter, where raspberries or other fruits are mostly evenly distributed on the belt. For the future, it could be interesting to train those datasets with our proposed flow and web application.