Abstract:Abstract: In order to improve the recognition precision and speed for apple, and further improve the harvesting efficiency of apple harvesting robot, an apple recognition method based on combining K-means clustering segmentation with genetic radial basis function (RBF) neural network is proposed. Firstly, the captured apple image is transformed into L*a*b* color space, and then under this color space, the K-means clustering algorithm is used to segment the apple image. The color feature components and shape components of segmented image are extracted respectively. The color features include R, G, B, H, S and I, a total of 6 feature components; and the shape features include circular variance, density, ratio of perimeter square to area, and 7 Hu invariant moments, a total of 10 shape components. These extracted 16 features are used as the inputs of neural network to train RBF neural network, and get the apple recognition model. Due to some inherent defects the RBF neural network has, such as low learning rate, easily causing over fitting phenomenon, genetic algorithm (GA) is introduced to optimize the connection weights and the number of hidden layer neurons. In this study, a new optimization way is adopted, that is, the hybrid encoding of the number of hidden layer neurons and connection weights is carried out simultaneously. This moment, the learning of weights is not completed, and the least mean square (LMS) is used to further learn the connection weights. Finally, an optimized neural network model (GA-RBF-LMS) is established, which is to improve the operating efficiency and recognition precision. In the experiments, there are 150 images captured, and they have 229 apples; among them 50 images are selected as training samples, and the rest as testing samples. Every image for training sample has only one apple, so the testing samples have 179 apples. In order to get the precise model, fruits of apple are together with branches and leaves for training during the training process, which avoids the influence of branches or leaves shade on the recognition to some extent. So the training samples have 50 apples, 50 branches and 50 leaves, which are a total of 150 training samples, and the outputs of neural network include 3 classes. In order to compare with the traditional back propagation (BP) and RBF neural network, and GA-RBF algorithm, a series of experiments are carried out. After repeated trainings of 50 times, the results show that the successful training rate of the GA-RBF-LMS is the highest, which can reach 100% and get the minimum training error; but its running time is the longest, because the 2 optimizations of genetic algorithm and LMS are at the expense of the time. The recognition rates of the fruits with different growth postures, such as fruit without obscuration, overlapping fruit and covered fruit, are calculated respectively. After repeated experiments of 50 times, the results show that these 4 recognition models can achieve very good effect for recognizing the fruit without obscuration. For covered fruit and overlapping fruit, the recognition rate of GA-RBF-LMS is the highest, which can reach 95.38% and 96.17%, respectively. Looking from the overall, the recognition rate reaches 96.95%, recognizing 179 apples consumes 1.75 s, and the sum of square of error is the smallest. From the training time, the GA-RBF-LMS algorithm is the longest, whose average training time is 4.412 s for 150 training samples, but the training success rate can reach 100%, which saves the time wasted in human trying to construct the network structure. All of these illustrate that the GA-RBF-LMS neural network model has the higher operating efficiency and recognition precision, and it can be applied in target recognition for apple harvesting robot.