Research of algorithms for recognizing and determining the coordinates of apple fruits on the crown of a tree

. This paper presents the results of a study of the Apple fruit recognition system on the crown of a tree based on the use of an artificial neural network (ANN). The article describes the process of conducting a multi-factor experiment to determine the relationship between the operating conditions of ANN: illumination, shooting distance, photo resolution, and determining their optimal parameters that allow obtaining the highest quality results. The obtained mathematical model reflects the relationship of such factors as illumination, distance to the object, shooting resolution and their influence on the reliability (accuracy) of object recognition in the photo. The optimal parameters of these factors are determined, at which the maximum value of recognition reliability of the desired objects is reached.


Introduction
Robotic harvesting can provide a potential solution to the problem of low productivity in agriculture and its marginality by reducing labor costs (greater persistence and high repeatability), increasing the efficiency of using shift time and improving product quality. For these reasons, over the past three decades, there has been a growing interest in using agricultural robots to collect fruits and vegetables [1][2][3]. Designing such platforms involves many complex tasks, such as identification and collection. However, the development of an accurate fruit detection system is an important step towards fully automated harvesting robots, since this system of external perception (technical vision) is involved first, before subsequent operations and actions, since if the fruit is not detected or visible, it cannot be collected [4,5]. This step is complicated due to various factors, including changes in the day light, focusing on the object, the distance to it, and the cases, when the fruit is partially covered with foliage or other fruits. In order to overcome these technical barriers and design a fully functional fruit recognition system with the specified parameters of work quality, it is necessary to conduct an experimental study and substantiate the working and optimal parameters of the technological process [6].

Purpose of research
Investigate and identify parameters that affect the quality of the apple fruit recognition system and justify their optimal values (ranges).

Materials and methods
Devices and materials used: a measuring tape with a tape length of 3 m, a green fabric screen (dimensions 2000x1500 mm), an artificial tree (a model), Radex LUPIN lux meter, 4 varieties of fruit of 3 pcs. each (apples of different colors), Canon EOS 1100D camera, Canon EOS 40D camera, Canon SpeedLite 430EX2 camera, personal computer with pre-trained artificial neural network (ANN).
Variable factors: -distance to the recognized object, cm, X1; -total illuminance level, lx, X2; -the receiving image resolution, Mpix, X3; The outcome parameter is the confidence (the degree) of recognition of apple fruits in the image. It is defined, as the ratio of the number of fruits detected and recognized by ANN to the total number of fruits present in the photo and manually identified by a person. The natural values of the factors and their variation intervals are shown in table 1. The plan for conducting a multi-factor experiment is shown in table 2.

Results and discussion
The images for test processing and primary analysis were obtained under the following conditions: -the artificial light -using 2 cameras Canon EOS 1100D and Canon EOS 40D -placing 14 fruits of various sizes and colors on a surface with a green monochrome background from a distance of 0.5 m Meanwhile, the number of images taken from both cameras differs by 4 times (8 and 32, respectively), since the 40D camera used different illumination values set programmatically.
The main data-set consists of 193 and 289 images taken on Canon EOS 1100D and Canon EOS 40D cameras, respectively. Image resolution is 4272x2848 pixels and 3888x2592 pixels, image format png. Some of the images, about 5% of the total number were not included in the final sample, as were rejected due to the presence of foreign objects in the image, the poor image quality, or the violation of the experiment conditions.
The architecture of the developed neural network is shown in figure 1. The main difference between the applied detection algorithm and the existing ones is to determine the probability of the presence of the desired object in the entire image, in each of its segments, regardless of their number. The search is performed by using the pre-configured descriptors for the entire image field. Then, a conclusion about the presence of the desired object in the image is made based on the concentration of probabilities.
As a result of processing the experimental data, the equation of the mathematical model was obtained. The coefficients of the mathematical model equation are shown in table 3.the Value of the student's criterion for each coefficient and its significance are shown in table 4. 1,37 Conclusion on the adequacy of the mathematical model: according to the Fisher criterion, the equation of the mathematical model is adequate. The model is applicable for solving production tasks.
As a result of the data-set analysis, the accuracy of the ANN recognition of fruits was 88.39% for images obtained from the 1100D camera and 93.88% from the 40D, respectively.
The analysis of the main data-set with the help of ANN revealed the following patterns.
Taking into account the overall recognition accuracy across the entire sample, the best result was obtained by the camera with a higher matrix resolution: 61.67% -D40, with 10.2 Mpix matrix and 70.27% -D1100 with 12.2 Mpix matrix.
The best detection result obtained during the test data-set general analysis , in the context of the shooting conditions of the analyzed image, was received when the distance to the object was minimized-0.5 m, the object was in focus, using the maximum possible resolution (12.2 Mpix) and the absence of moisture on the fruit surface, is 75.78%.
However, if there is a moisture on the surface, the result is slightly worse, reducing the detection accuracy to 74.48%.
The distance to the object and the illumination have a much greater impact on the final result. By changing the distance from 0.5 to 1.5 m in 0.5 m increments, the detection accuracy changes from 75.78% (0.5 m) to 57.8% (1.5). The intermediate value of the obtained detection accuracy (1 m) is 66.03%.
When the average luminance level changes from 100 Lux to 300 Lux, the degree of detection accuracy changes from 64.01% to 74.3%. At the same time, if there is no focus on the object, the presence of the glare on the image and general illumination, the detection result is the most inaccurate -about 43%, in the context of analyzing images of this type by data-set.

Conclusions
The experimental investigations have proved the efficiency of the developed algorithms based on the artificial neural networks for the technical vision system for searching and determining apple fruits. The created algorithms for processing input graphic data and the computer vision system allow recognizing apple fruits with a high degree of accuracy (up to 93.88%).
The distance to the recognized object, the illumination and the image quality significantly affect the spotting of apple fruits and the determination of their location, what further effects on the efficiency of harvesting by a robotic manipulator.
To determine the optimal operating modes and the efficiency increase of the presented technology, the additional research is required in terms to optimize the technology in the conditions of real agricultural production of horticultural crops. The use of computer vision systems in agricultural operations represents a huge potential for the automation of harvesting, auditing and decision-making control.