Original papers
A robust algorithm based on color features for grape cluster segmentation

https://doi.org/10.1016/j.compag.2017.08.025Get rights and content

Highlights

  • A robust algorithm based on ANN and GA for segmenting grape clusters and leaves from background using color features was developed.

  • GA was employed for optimizing of ANN structure and selecting supreme color features simultaneously.

  • The overall accuracy of the pixel classification of the algorithm was 99.40%.

Abstract

Image processing has been widely used for automation purposes in modern agriculture. The algorithm development for the image segmentation is the most controversial and challenging issue in orchard environment which researchers encounter. This paper describes a robust algorithm based on artificial neural network (ANN) and genetic algorithm (GA) for segmenting grape clusters from leaves and background using color features near to harvest. GA was employed for optimizing of ANN structure and selecting supreme color features simultaneously. The results showed that GA specifies the 8 color features as supreme features and define 8–15-35–3 as the best structure of the ANN. The overall accuracy of the algorithm was 99.40%. The promising results in algorithm development described in this study lead to introduce it as a practical sensing tool in precision agriculture as well as those industrial facilities dealing with image analysis.

Introduction

There are several studies in the literature where image analysis has been applied to detect agricultural products. Mora et al. (2016) proposed an image segmentation algorithm to exclude contributions of non-leaf materials from leaf material in the analysis. Shapiro et al. (2009) and Steward et al. (2002) developed an image processing algorithm to detect the date palm and weed targets, respectively and obtained results were used for further operations. Amatya et al. (2015) investigated the image processing algorithm to branch detection for cherry harvesting. They used Bayesian classifier and R, G and B color features of each pixel for segmenting branch pixels and achieved 89.6% branch pixel classification accuracy.

Color features have been used for red and green apple recognition by Zhou et al. (2012). Their results showed that color difference features (R-G, R-B, G-R, and R-G) had good potential for segmentation of apple fruits form background (leaves, branches, and sky). Another study was carried out on apple identification based on color and shape features in order to estimate crop-load (Gongal et al., 2016). Grayscale images were obtained by subtracting green and blue channels from red channel (R-G and R-B). Then Otsu’s threshold method was used to convert the gray images to binary images. Canny edge detector was carried out to detect edge and Circular Hough Transformation (CHT) was applied to identify circular objects that are likely to be apples. The apple identification accuracy was 79.8% in their study.

Diago et al. (2012) were developed an approach by generating a supervised classifier based on the Mahalanobis distance to characterize the grapevine canopy, and assessed leaf area and yield using RGB images. The segmentation algorithm was able to distinguish the leaves with 92% and grape cluster with 98% accuracy. The ability to segment was depended on the contrast between black grapes with leaves and background. Berenstein et al. (2010) developed an image processing algorithm for detection of grape cluster based on Pearson's correlation method for deleting the effective features and a decision tree algorithm for classification. Their obtains showed that mean gradient magnitude of the R, G, B and V channels were supreme features for segmenting the grape cluster area from foliage area. Also, they found that grape cluster detection leads to 30% reduction in use of pesticides. Nuske et al. (2014) presented the image processing technique for yield estimation in the vineyard. Their results demonstrated that color features and texture-descriptors worked very well in different light conditions for grape cluster segmentation. In addition, results indicated that total yield could be estimated with an average error between 3% and 11%.

Artificial neural network (ANN) and genetic algorithm (GA) and their combination have shown to be powerful tools for solving the complex problem that has not exact solutions especially in image segmentation area (Al-Mohair et al., 2015, Khan and Jaffar, 2015).

Important steps in improving the performance of the ANN classifier are to find the best structure of the ANN and select the best features used as input to the ANN for classification. The ANN structure has two major parameters: number of hidden layers and neurons in each hidden layers and one of the common methods used by authors for finding the best structure is train and error method (Salehi et al., 2011, Behroozi-Khazaei et al., 2013). Selecting the best features for classification means that those features that do not help to improve the classification accuracy should be removed from the feature vector. Nevertheless, an effective feature vector must contain sufficient elements for classification (Omid et al., 2010, Banakar et al., 2017). Appling the soft computing method such as GA for finding the best structure of the ANN and best features selection is interesting and growing.

The GA was already used for optimizing the ANN structure (Mohebbi et al., 2011) and for feature selection (Vafai and De Jong, 1992, Chtioui et al., 1998). The feed-forward neural networks are also the most popular architectures due to flexibility architecture and good representational capabilities (Salehi et al., 2011). Liu et al. (2016) performed the ANN technique for on-tree recognition of apple at nighttime for apple harvesting robots. The ANN has adopted a classical topological structure with 3 layers and the number of nodes in hidden layer was determined by an empirical formula. The color components of RGB and HSI are used as input data for ANN. Also for better segmenting of regions around the edge of apples, the color difference between recognized regions and edge (R1–R2, G1–G2, B1–B2) and the distance of them are extracted which is applied as input data of the second ANN. Their results indicated that proposed algorithm worked very well for apple segmenting with 97% accuracy. Furthermore, Zheng (2005) developed an algorithm for tree crown detection based on ANNs. The tree crown features were extracted after image segmentation. These features were put into the designed ANN, and six unknown typical tree crowns (cone, oval, spherical, cylindrical, umbellate, and truncate) recognized precisely and effectively. No quantitative results were found. Cheng et al. (2017) were developed the new approach of using image analysis and tree canopy features to predict the first reliable time of yield (early yield) with ANN. For each canopy image, pixels were segmented into fruit, foliage, and background using image segmentation. The four features extracted from the image data set: total cross-sectional area of fruits, fruit number, total cross-section area of small fruits, and cross-sectional area of foliage that were used as inputs and actual weighted yield per tree was used as output. The results showed that correlation coefficients (R2) between the estimated and the actual weighted yield, mean forecast error (MFE) measures the unbiasedness between the estimated and the actual weighted yield, mean absolute percentage error (MAPE), and root mean square error (RMSE) were 0.81, −0.05, 10.7%, 2.34 kg/tree, respectively.

As mentioned earlier, image processing has been used to assist with precision agriculture practices specially yield estimation. On the other hand, Gongal et al. (2015) were reported that one of the issues which can increase the overall accuracy of fruit detection is the improvement of image segmentation method. While the fruit segmentation is the issue when the green/greenish fruits are surrounded by green leaves, a color segmentation method is not an easy task. Therefore, a robust algorithm is needed for fruit detection with high accuracy regardless of fruit color and application environment. The objective of this study was to present a robust method based on ANN and GA for grape cluster segmentation when the grape is getting mature. The core idea was to determine the number of hidden layers and number of neurons in hidden layers of the ANN and selecting the best color features as input in the ANN which was simultaneously performed with a genetic algorithm technique.

Section snippets

Materials and methods

Developing the proposed algorithm involves three phases; first phase dealing with developing the image processing algorithm for extracting the color features and preparing the dataset matrix, second phase dealing with selecting the supreme color features from the dataset and best structure of the ANN as classifying algorithm, and the third phase dealing with evaluating the performance of the developed algorithm. For developing this algorithm MATLAB software was used. The following sections

Results and discussion

Fig. 6 illustrates the variation of the best fitness value with generations. As shown, the algorithm automatically searches for the appropriate chromosome according to the given objective. Therefore, the value of best fitness is decreased across generations and the best fitness value emerged at the 5th generation and after that its value has not any change until 30th generation. For this reason, the optimization process stopped at 30th generation. The optimization process resulted in selection

Conclusions and future works

The image processing techniques have been used across a vast range of agricultural productions and many have been trying to develop a stronger algorithm for approaching perfection. In the current study, the color features were considered as the basis for image segmentation in vineyard. The core concept was to use the genetic algorithm and artificial neural network structure for selecting the supreme color features. The novel proposed algorithm was limited to detect the grape cluster located

References (35)

  • M. Omid et al.

    Development of pistachio sorting system using principal component analysis (PCA) assisted artificial neural network (ANN) of impact acoustics

    Expert Syst. Appl.

    (2010)
  • S. Amatya et al.

    Detection of cherry tree branches with full foliage in planar architecture for automated sweet-cherry harvesting

    Biosys. Eng.

    (2015)
  • A. Banakar et al.

    Combined application of decision tree and fuzzy logic techniques for intelligent grading of dried figs

    J. Food Process Eng.

    (2017)
  • R. Berenstein et al.

    Grape clusters and foliage detection algorithms for autonomous selective vineyard sprayer

    J. Intell. Service Robot.

    (2010)
  • H. Cheng et al.

    Early yield prediction using image analysis of apple fruit and tree canopy features with neural networks

    J. Imag.

    (2017)
  • M. Diago et al.

    Grapevine yield and leaf area estimation using supervised classification methodology on RGB images taken under field conditions

    Sensors

    (2012)
  • G. Dunn et al.

    Yield prediction from digital image analysis: a technique with potential for vineyard assessments prior to harvest

    Aust. J. Grape Wine Res.

    (2004)
  • Cited by (50)

    • Improving crop image recognition performance using pseudolabels

      2024, Information Processing in Agriculture
    • Application of AI techniques and robotics in agriculture: A review

      2023, Artificial Intelligence in the Life Sciences
    • A review of core agricultural robot technologies for crop productions

      2023, Computers and Electronics in Agriculture
    • Towards real-time tracking and counting of seedlings with a one-stage detector and optical flow

      2022, Computers and Electronics in Agriculture
      Citation Excerpt :

      Object detection is an intuitive approach to count crops and fruits in static images. Researchers have developed image processing algorithms based on color, shape, and texture to detect broccoli seedlings (Zou et al., 2019), grapes (Behroozi-Khazaei and Maleki, 2017; Skrabanek and Doležel, 2017), bananas (Fu et al., 2019), and apples (Lv et al., 2016; Liu et al., 2019). Recently, deep learning methods, such as deep convolutional neural network (CNN) have created new opportunities for object detection because deep learning techniques can learn features automatically through supervised learning (Cheng et al., 2017).

    View all citing articles on Scopus
    View full text