Next Article in Journal
Advances and Challenges in RNA Interference Technology for Citrus Huanglongbing Vector Control
Previous Article in Journal
Fatty Acid Profile, Tocopherol Content of Seed Oil, and Nutritional Analysis of Seed Cake of Wood Apple (Limonia acidissima L.), an Underutilized Fruit-Yielding Tree Species
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Infield Apple Detection and Grading Based on Multi-Feature Fusion

1
College of Mechanical and Electronic Engineering, Northwest A&F University, Yangling 712100, China
2
Xuzhou Construction Machinery Group Research Institute, Xuzhou Construction Machinery Group Co., Ltd., Xuzhou 221004, China
3
Technical Faculty, S. Seifullin Kazakh Agro Technical University, Nur-Sultan 010000, Kazakhstan
*
Author to whom correspondence should be addressed.
Submission received: 30 July 2021 / Revised: 26 August 2021 / Accepted: 28 August 2021 / Published: 2 September 2021

Abstract

:
A field-based apple detection and grading device was developed and used to detect and grade apples in the field using a deep learning framework. Four features were selected for apple grading, namely, size, color, shape, and surface defects, and detection algorithms were designed to discriminate between the four features using machine vision and other methods. Then, the four apple features were fused, and a support vector machine (SVM) was used for infield apple grading into three grades: first-grade fruit, second-grade fruit, and other-grade fruit. The results showed that for a single index, the accuracy of detecting the apple size, the fruit shape, the color, and the surface defects, were 99.04%, 97.71%, 98%, and 95.85%. The grading accuracies for the first-grade fruit, second-grade fruit, other-grade fruit, and the average grading accuracy based on multiple features were 94.55%, 95.71%, 100%, and 95.49%, respectively. The field experiment showed that the average grading accuracy was 94.12% when the feeding interval of the apples was less than 1.5 s and the walking speed did not exceed 0.5 m/s, meeting the accuracy requirements of field-based apple grading.

1. Introduction

Fruit grading is crucial for fruit marketing and is directly related to the effects of fruit packaging, transportation, storage, and sales [1,2,3,4]. The external and internal quality of fruits are important factors affecting market price and customer satisfaction [5,6,7,8]. When people buy apples in the market, they typically evaluate the quality of apples based on exterior features related to fruit appearance, such as size, color, shape, and surface defects [6,9,10,11]. Therefore, grading apples according to their appearance is an important indicator to improve the market value of apples.
Apple field grading is essential to improve the economic value of the fruit and significantly affects the industrial chain of apple production [1]. Infield grading of apples provides farmers with fruit with a known status grade, and therefore improves the economic benefits [2,12,13,14]. In addition, the elimination of apples with surface defects can help to reduce the cross-infection between diseased apples during storage and transportation [15]. The downstream production enterprises can adopt targeted storage, processing, grading, and other processes according to the field grading results of the apples to increase the competitiveness of enterprises. Apple field grading refers to grading freshly harvested apples in orchards. The environment in apple field grading is more complex than in industrial grading and is easily affected by vibration and other factors [16].
Machine vision has achieved good results for grading agricultural products, such as apples, tomatoes, potatoes, and mangoes [17,18,19,20,21,22,23,24,25]. Pourdarbani et al. developed a jujube sorting system based on machine vision. The processing time was 0.34 s per image and 15.45 kg of jujube per hour [26]. Kumar et al. designed and developed a nondestructive grading method for pomegranate fruit based on wavelet transform and an artificial neural network [27]. The accuracy rate for distinguishing between unblemished and blemished pomegranates was 91.3%. Chiu et al. developed a system for the online detection of apple damage [13]. The system used a chlorophyll fluorescence image to detect the crush injury of apples and could process 92 apples per hour. Although the detection accuracy of crush injury was high, the detection speed was relatively low. In order to improve the accuracy and the detection speed for apple grading, Hang and Fei presented an online detection method of apple grading based on machine vision features [28]. The accuracy of apple grading was 95%, and the average grading rate was four apples per second. Zhang et al. designed an online grading system integrated with an apple-picking robot using machine vision to detect the apple size and rotten areas [2]. The grading accuracy was 89.71%, and the grading time was 2.89 s per apple. Sadegaonkar et al. established a roller conveyor belt to detect moving and rotating apples and sort apples automatically according to their color, size, weight, and maturity [29]. Vakilian et al. designed a system based on image texture feature extraction and used an artificial neural network to classify apples [30]. The detection accuracy of golden crown apples and snake fruits was 89% and 92%, respectively. Bhatt and Pant proposed an apple grading system based on machine vision and an artificial neural network (ANN), and developed specific hardware and software systems to automate apple grading [31]. The accuracy of automatic apple grading was 96%. Existing apple grading equipment required a stable environment and was relatively bulky and not suitable for grading fruits in the field.
Infield apple grading is mainly based on the appearance of apples, including the color, shape, size, and surface defects. A single characteristic does not adequately reflect the quality of apples. In this study, a field-based apple detection and grading device was developed, and Fuji apples were analyzed. The contribution of this study was: (1) the rapid detection of apple surface defects by the single-shot multibox detector (SSD); (2) a support vector machine (SVM) and multi-feature fusion of the apples’ features were used to detect various surface defects in fruits, so as to perform infield apple grading.

2. Materials and Methods

2.1. The Apple Field Grading Equipment

The apple field grading equipment consisted of a guidance mechanism, a conveying device, a detection device, an executing mechanism, and a collection device, as shown in Figure 1a. The guidance mechanism consisted of a guiding baffle and a direction-adjusting brush. The conveying device consisted of four parallel conveyor belts and motors. The detection device consisted of a detection box, industrial cameras, a photoelectric sensor, an illumination source, and a computer. The actuating device included a steering gear, actuating push plate, and other parts, and the collection device consisted of a collection pipeline and a collection box.
The detection device was the core part of the field grading equipment and was used to extract the apple diameter, shape, color, and surface defects, which were used to grade the apples. The detection device included a closed cuboid box with a size of 400 × 400 × 500 mm3 and industrial cameras (MV-UBS31GC, Medway Vision Technology Co., Ltd.) with a resolution of 720 × 480 pixels and a frame rate of 108 fps. The cameras were installed on the top and on both sides of the detection box, as shown in Figure 1b. The three cameras ensured that the two side and top images of the apple could be taken for feature detection, but the area of contact between the apple and the conveyor belt could not be captured by the camera. The industrial cameras were calibrated using Zhang Zhengyou’s calibration method [32]. Two LED strips were placed at the top of the box for stable and bright lighting.
The harvested apples entered one end of the guidance mechanism (Figure 1a) and were sent to the detection device by the conveyor belt for detection and grading. The results were sent to the actuating device, which pushed the apples of different grades into different collection pipelines to complete the field grading task. The workflow is depicted in Figure 2.

2.2. Apple Grading Criteria and Feature Extraction

We used the standard of fresh apples (GB/T 10651-2008, General Administration of Quality Supervision, Inspection and Quarantine of the People’s Republic of China) and conducted market research to determine the appropriate grading standard. The standard is listed in Table 1. The final grade of the apples is based on the lowest grade of a single characteristic, such as the size, color, shape, and surface defect of the apples. Three levels were used: first-grade, second-grade, and other-grade fruit. The apple size was the maximum cross-sectional diameter of the apple. The apple color was characterized by the ratio of the red area to the total apple surface area.

2.2.1. Extraction of the Apple Size

In this research, the minimum circumscribed circle of the apple was used to calculate the maximum cross-sectional diameter of the apple in the image obtained from the top camera to extract the apple size, which was the same method used by some scholars [33]. First, the edge pixels of a binary apple image were detected, their coordinates were determined, and the centroid coordinates of the circumference of the apple were obtained based on the coordinates of the edge pixels. Then, the distance from the centroid to the edge of the apple was calculated, representing the diameter of the minimum circumscribed circle.

2.2.2. Extraction of the Fruit Shape

A regular shape is an important index in apple grading and also influences the consumer. Deformed apples usually sell at a lower price. In this study, the roundness and shape index were used to evaluate the apple shape.
The roundness describes the complexity of an object’s boundary. The range of the roundness is [0, 1], and the closer the value is to 1, the rounder the shape is. The roundness E1 was calculated as follows:
E 1 = 4 π S P 2
where S is the apple area, i.e., the number of projected pixels on the apple’s surface; P is the perimeter of the apple, i.e., the number of pixels on the apple’s circumference.
The shape index E2 is the ratio of the long axis to the short axis of the apple:
E 2 = D 1 D 2
where D1 is the long axis of the apple, i.e., the maximum length from the bottom of the calyx to the stem of the apple, mm; D2 is the short axis of the apple, i.e., the maximum cross-sectional diameter of the apple, mm. When the shape index has a range of 0.6–0.8, the apple is oblate, 0.8–0.9 is round or nearly round, 0.9–1.0 is oval or conical, and 1.0 or more is oblong [6].

2.2.3. Extraction of the Apple Color

The apple’s color is a visual characteristic and an indicator of the apple’s quality and maturity. Therefore, the color of apples is crucial in apple grading. The hue, saturation, and value (HSV) color space model was adopted in this study since it is a robust color model.
The HSV color space model separates the hue, saturation, and value (brightness) of the apple’s color. The hue is least affected by illumination and most suitable for distinguishing different apple colors. Therefore, we selected the hue of the HSV image to extract the apple’s color. In this research, we used OpenCV to convert the collected apple image into the HSV space, and divided the value of hue by 2 to obtain the range of hue from 0 to 180. The red, yellow, and background components were extracted from the hue of the side view image of the apple for the statistical analysis, as shown in Figure 3.
The hue of the background was substantially different from that of the red parts of the apple. The hue ranges of the red parts were [0, 15] and [175, 180] (as shown in Figure 3a), the hue ranges of the background parts were [50, 125] (as shown in Figure 3c), and those of the yellow components were about [20, 25] (as shown in Figure 3b). Thus, the ratio of the red area was used to describe the color of the apple. The ratio of the red area is the ratio of the number of red pixels in the hue to the total number of pixels in the apple area:
H r = i = 1 N Mask i M
where M is the total number of apple pixels in the camera field of view; Maski is set to 1 when the hue value of the ith pixel is within the red threshold range; otherwise, it is 0. The red threshold ranges from [0, 15] to [175, 180]. The red area ratios of the hue values of the apple images obtained by both cameras were calculated and averaged to describe the color of the apple. The value ranges from 0 to 1, and the closer it is to 1, the redder the apple is.

2.2.4. Extraction of the Fruit Surface Defects

Surface defects are the most critical factors in apple grading. During growth and harvest, the apples are affected by friction, squeezing, and insect pests, resulting in physical damage. Damaged apples are prone to mildew and decay, which affect the taste and commercial value of the apples and can reduce the storage capacity of entire batches of apples.
Apple surface defects include crush injury, stab injury, abrasion injury, sunburn, hail injury, cracks, splits, insect damage, and so on. Due to the low probability of some fruit surface defects, such as sunburn and hail injury, it is necessary to determine the proportion of different types of detected fruit surface defects. In order to obtain accurate results, we collected 1000 Fuji apples from the Huicheng Orchard (34.31° N, 108.02° E) in Yangling, Shaanxi Province and counted the surface defects. The statistical results are listed in Table 2.
It can be seen from the statistical results in Table 2 that the ratio of bruising and cracks is high, which was due to the physical damage caused by falling or colliding apples during picking. The bruises were divided into two categories: mild bruises, referred to as bruises, and severe bruises. Slight bruises were similar in color to the surrounding epidermis, without obvious discoloration. Severe bruising was caused by severe impact and pressure, and even juice flowing out. Due to the fact that the types of fruit surface defects described by cracks and splits were basically the same, the two types of cracks and splits were combined into cracks. Other surface defects were relatively few, among which damage caused by farm chemicals was the most, and other kinds of fruit surface defects were collectively referred to as skin defects.
In this study, the TensorFlow deep learning framework with the single-shot multibox detector (SSD) deep learning algorithm was used to identify the apple surface defects to ensure high accuracy of the surface defect detection of the field grading equipment. SSD is a target detection method [34,35]. The algorithm changes the two fully connected layers of the VGG-16 network structure into convolution layers, and adds four convolution layers to construct the network structure. The specific network structure is shown in Figure 4.
The overall objective loss function is a weighted sum of the localization loss (Lloc) and the confidence loss (Lconf):
L ( x , c , l , g ) = 1 N ( L c o n f ( x , c ) + α L l o c ( x , l , g ) )
where N is the number of matched default boxes, x indicates whether the prediction box matches the real label box, if so, it is 1, otherwise it is 0; c represents the confidence of softmax function for each classes; l represents the prediction box; g represents the real label box and the weight term α is set to 1 by cross-validation [35].
The images of the apples used in the training set were manually labeled using the LabelImg toolbox. The labels included no defect, bruising, severe bruising, cracks, and skin defects. Due to the small number of samples, transfer learning was used to optimize the parameters. We used the trained parameters of the MobileNetV2 classification network, removed the last classification layer, kept the parameters of the VGG5 layer unchanged, and randomly initialized the parameters of the other layers using a Gaussian distribution with 0 mean and 0.01 standard deviation. A batch random gradient descent algorithm was used for parameter optimization. The batch size was 64, the initial learning rate was 0.04, and the 800 images with a size of 3024 × 3024 pixels were scaled to 300 × 300 pixels. After training, the model was applied to the test set to detect surface defects in the apples. Rectangular boxes with scores exceeding 50% represented the areas with surface defects.
To verify the model accuracy, the apples in the image were checked, and the apple damage in the test set images was manually marked. An intersection over union (IOU) was performed to obtain the overlap between the predicted results obtained from the SSD deep learning algorithm and the actual results. According to the previous test, it can be considered that the IOU is 70% with high accuracy, that is, if the IOU is more than 70%, it is considered that the detection of the fruit surface defect type is correct, otherwise, it is considered that the detection is incorrect. The evaluation indices of detection accuracy are recognition precision (P), recall (R), and harmonic mean F1, and the formula is as follows:
P = T P T P + F P × 100 %
R = T P T P + F N × 100 %
F 1 = 2 P R P + R × 100 %
where TP is the number of surface defects detected correctly; FP is the number of non-surface defect areas mistakenly detected as surface defect areas or surface defect detection errors; FN is the number of surface defect areas mistakenly detected as non-surface defect areas; F1 is the harmonic mean of P and R, and the closer it is to 1, the better the model is.

2.3. Apple Grading Method Based on Feature Fusion

It is one-sided to only rely on a single feature to classify apples. When experienced fruit farmers grade apples, they comprehensively evaluate the advantages and disadvantages of apples according to their size, color, shape, and surface defects. Apple grading in the field requires fusing multiple related features to obtain a more accurate grade. Therefore, this study integrated four physical characteristics of apples, namely, size, color, shape, and surface defects. Five parameters of the four physical characteristics were used to evaluate and grade apples comprehensively. The five parameters include the fruit diameter for evaluating the fruit size, the red area ratio for evaluating the color, the roundness and fruit shape index for evaluating the fruit shape, and the surface defect types.
The apple diameter, red area ratio, roundness, and shape index were used directly as input features, and the degree of influence of the surface defects on apple grading was independently calibrated for the different categories. The extracted features were combined into a multi-feature high-dimensional vector Xi = [size, color, roundness, shape index, surface defects] of the apple. The actual grades of the apples were determined manually by experienced fruit farmers according to the grading standards listed in Table 1.
Obtaining the grade can be regarded as a process of self-learning using the training samples {(Xi, Yi): i = 1, 2,…, n}, where Xi is the feature vector, and Yi ∈ {±1} is the class label of the ith training sample. The optional boundary is defined by Equation (8):
f ( x i ) = ω x i + b
The problem of defining ω and b values can be transformed into a convex optimization problem expressed by Equation (9):
min ( 1 2 | ω | 2 + σ ε i )
where σ is the penalty coefficient, εi is the error, and labi(ωXi + b) ≥ 1 − εi.
A multi-class support vector machine (MSVM) was used to grade the apples to ensure high accuracy [17]. The MSVM is a specific application of the SVM that assigns one of many class labels to the input [22]. The multi-feature high-dimensional vector was used as the independent variable, and the real grade was used as the dependent variable to construct a classification model. In the MSVM classifier, the type of kernel function and the setting of the parameters have a crucial impact on the classifier performance. In this research, the radial basis function (RBF) was used as the kernel function of the SVM, and the optimal penalty coefficient and kernel function parameters of the grading model were obtained by a grid optimization algorithm and triple cross-validation.

2.4. Field Test

The equipment was transported to the Huicheng Orchard in November 2019 for a field experiment to verify the accuracy of the infield grading equipment and multi-feature fusion algorithm. A movable cable tray was used to supply power to the grading equipment in the field; the voltage was 220 V. The detection box was protected by a black cover to prevent light infiltration and improve the quality of image acquisition. The pickers placed the harvested apples onto the conveyor belt for grading. The speed of the conveyor belt was 0.4 m/s, and the grading equipment was manually controlled to operate in a straight line between the fruit trees, as shown in Figure 5.

3. Results and Discussion

3.1. Results of Apple Size Detection

The apple size obtained from the algorithm was compared with the manual measurements of 10 apple samples to determine the accuracy of the minimum circumscribed circle method for obtaining the apple diameter. The manual method consisted of measuring the maximum cross-sectional diameter of the apple with a vernier caliper. The comparison results are listed in Table 3.
The average accuracy of the algorithm was 99.04%, the maximum absolute error between the manual measurements and image measurements was 1.4 mm, the average absolute error was 0.75 mm, the maximum relative error was 1.8%, and the average relative error was 0.96%. The results indicate that this method can accurately extract the fruit size.

3.2. Results of Apple Shape Detection

The results of the apple edge extraction are shown in Figure 6. Figure 6c depicts the result of superimposing the fitting curve on the original image, indicating a good fit of the apple contour. The number of pixels in the apple area was 15,457, and that of the perimeter of the apple was 465. Therefore, the roundness of the sample was 0.90.
The side view image of the apple was transformed into the HSV color space, and the image was binarized, as shown in Figure 7. The distance between the top and bottom of the apple is the length of the long axis of the apple.
The shape index extraction results of 10 apple samples were compared with manual measurements, as listed in Table 4. The average accuracy of the shape index obtained from the image was 97.71%, the maximum relative error was 3.3%, and the average relative error was 2.3%. The experimental results show that the image-based method of obtaining the apple shape index has a high accuracy, meeting the grading requirements.

3.3. Results of Apple Color Detection

The red area ratio is used as a single standard for grading to determine if the apple color obtained from the image can be used for grading. A red area ratio of more than 80% indicates first-grade fruit, more than 55% is second-grade fruit, and less than 55% is other-grade fruit. We selected 100 mature apples randomly from the orchard, and experienced fruit farmers were used as appraisers to grade the apples based only on the color. The accuracy of the manual grading method was compared with the grading results obtained from the red area ratio. The results are listed in Table 5.
Out of 100 apples, 98 apples were graded correctly; thus, the grading accuracy was 98% based on using only the color index. The experiment shows that it is feasible to identify apple color using the red parts of the hue.

3.4. Results of Surface Defect Detection

We used 200 images in the test set to obtain the surface defects and evaluate the detection accuracy of the deep learning detection algorithm based on SSD. We inputted the 200 images of the test set into the trained network, marked the different types of surface defects with different color identification boxes, and labeled them. Some apples had multiple types of surface defects. The identification results are shown in Figure 8.
It can be seen in Figure 8 that SSD can accurately detect one type of surface defect of a single apple, and can also detect two types of surface defects of a single apple at the same time. The more fruit surface defects, the worse the quality of the fruit, which is conducive to improving the accuracy of apple infield grading.
The highest accuracy is obtained for an IOU threshold of 70%. Thus, the results are considered correct when the value exceeds the threshold and incorrect when the value is below the threshold. The surface defects of the tested apple images were counted. TP was 208, FP was 9, and FN was 20; therefore, equal to the precision (P) was 95.85%, the recall (R) was 91.23%, and the harmonic mean F1 was 93.48%, indicating that the detection accuracy of surface defects was high.

3.5. Results of Multi-Feature Detection

In this study, 510 apple samples were collected and used for grading. The size, red area ratio, roundness, shape index, and surface defects were extracted from the top view and side view images of the apples, and the apples were classified into three grades using the SVM. Table 6 lists the statistical results of the apple diameter, red area ratio, roundness, and shape index.
The manual grading by the fruit farmers resulted in 202 first-grade fruits, 280 second-grade fruits, and 28 other-grade fruits from the 510 samples. The classification results of the SVM training model are listed in Table 7. The accuracy of the model was 95.49%, meeting the accuracy requirements of apple field grading. The algorithm’s performance was the highest for the other-grade fruit (100%), and there were a few classification errors for the first-grade fruit and second-grade fruit. Through the analysis of the fruits with errors, it is found that the reasons for grading error are that (1) the area of contact between the fruit and the conveyor belt could not be captured by the camera, and the fruit characteristics could not be extracted. The part of the fruit in contact with the conveyor belt had some defects, which were not easily detected by the image, leading to apple grading errors. (2) Slight bruises were not detected, resulting in the second grade apple being wrongly classified into the first grade, affecting the apple grading accuracy.

3.6. Field Test Results

When the feeding speed was high or the apples moved rapidly, the algorithm became unstable, resulting in a strong image blur, deviation of the apples from the central channel, and other problems that affect the accuracy of apple feature extraction. The apple detection and extraction device operated stably and accurately graded the apples when the feeding interval of the apples was less than 1.5 s, and the walking speed did not exceed 0.5 m/s. The field-based classification efficiency was about 40 apples/min. We used 170 apple samples to test the classification accuracy of the SVM model. The manual grading indicated 74 first-grade fruits, 87 second-grade fruits, and 9 other-grade fruits. The classification results of the SVM model in the field test are listed in Table 8.
In this study, the causes of the 10 wrongly grading apples were analyzed. It was found that the grading equipment will vibrate when driving on the uneven ground of the orchard. The irregular vibration of grading equipment leads to (1) a blurred image of the apple, and (2) the failure of fruit to stand upright on the conveyor belt. This leads to a decline in the accuracy of fruit size, roundness, and surface defect detection, which affects the grading accuracy of apples. With regard to the motion blur of the apple image caused by the driving of grading equipment on the uneven ground, we have begun to use the DeblurGAN method to deblur the apple images, so as to improve the accuracy of apple features extraction in the field.
In this research, grading equipment developed in different literature listed in Table 9 are compared. The indoor environment has stable illumination and vibration. In a stable indoor environment, high grading accuracy and rate are achieved. The field grading is affected by complex factors such as vibration, which result in low grading accuracy and efficiency. Compared with reference [2], the average grading accuracy and rate of the grading equipment in this study are 94% and 1.5 s per apple respectively. Therefore, the SVM with the fused features provides good performance and meets the accuracy requirements for field grading apples.

4. Conclusions

In this research, field-based apple grading equipment was designed and tested. The accuracy of the method for detecting four apple features was tested. The performance of infield apple grading using fused features was evaluated. More specifically:
(1) Four physical characteristics (apple diameter, color, shape, and surface defects) were extracted for apple grading, and their detection accuracies were 99.04%, 97.71%, 98.00%, and 95.85%, respectively.
(2) The SVM algorithm was used to integrate these four features for apple grading. The accuracy of apple grading was 94.55%, 95.71%, 100%, and 95.49% for first-grade fruit, second-grade fruit, other-grade fruit, and average accuracy, respectively. The field experiment showed that the average grading accuracy was 94.12% when the feeding interval was less than 1.5 s and the walking speed was less than 0.5 m/s, meeting the accuracy requirements of apple field grading.
(3) The proposed apple grading device was not combined with a harvesting machine. In a future study, we plan to improve the speed of detection and grading and the mechanical structure of the grading system integrated with a harvesting machine. Future work also needs to improve the conveying device to make the apple rotate during conveying. Taking multiple pictures of a rotating apple for feature extraction would improve the grading accuracy.

Author Contributions

Conceptualization, G.H. and J.C.; Funding acquisition, H.J., S.Z. and J.C.; Investigation, G.H., J.Z. (Jianguo Zhou), J.Z. (Jian Zhao), A.S. and J.C.; Methodology, E.Z. and J.Z. (Jian Zhao); Software, E.Z. and Z.G.; Supervision, H.J. and S.Z.; Validation, G.H.; Writing—original draft, G.H.; Writing—review and editing, E.Z., J.Z. (Jianguo Zhou), Z.G. and A.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research and APC were funded by the National Key Research and Development Program of China (NO. 2018YFD0701102) and the China Postdoctoral Science Foundation (No. 2019M653764).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Zhang, Z.; Pothula, A.K.; Lu, R. Economic evaluation of apple harvest and in-field sorting technology. Trans. ASABE 2017, 60, 1537–1550. [Google Scholar] [CrossRef]
  2. Zhang, Q.; Gu, B.; Ji, C.; Fang, H.; Guo, J.; Shen, W. Design and experiment of an online grading system for apple. J. South China Agric. Univ. 2017, 38, 117–124. [Google Scholar] [CrossRef]
  3. Lu, S.; Lu, S.; Li, Z.; Hong, T.; Xue, Y.; Wu, B. Orange recognition method using improved YOLOv3-LITE lightweight neural network. Trans. CSAE 2019, 35, 205–214. [Google Scholar] [CrossRef]
  4. Van Zeebroeck, M.; Van Linden, V.; Ramon, H.; De Baerdemaeker, J.; Nicolai, B.M.; Tijskens, E. Impact damage of apples during transport and handling. Postharvest Biol. Tec. 2007, 45, 157–167. [Google Scholar] [CrossRef]
  5. Tian, X.; Li, J.; Wang, Q.; Fan, S.; Huang, W.; Zhao, C. A multi-region combined model for non-destructive prediction of soluble solids content in apple, based on brightness grade segmentation of hyperspectral imaging. Biosyst. Eng. 2019, 183, 110–120. [Google Scholar] [CrossRef]
  6. Bai, S.-S.; Bi, J.-F.; Fang, F.; Wang, P.; Gong, L.-Y. Current Research Progress and Prospects of Technologies for Apple Quality Evaluation. Food Sci. 2011, 3, 286–290. [Google Scholar]
  7. Hu, G.; Bu, L.; Chen, J. Simulation to determination of significant parameters on apple stress for combing harvesting in trellis trained trees. Sci. Hortic. 2020, 274, 109654. [Google Scholar] [CrossRef]
  8. Li, L.; Peng, Y.; Li, Y. Design and experiment on grading system for online non-destructive detection of internal and external quality of apple. Trans. CSAE 2018, 34, 267–275. [Google Scholar] [CrossRef]
  9. Moallem, P.; Serajoddin, A.; Pourghassem, H. Computer vision-based apple grading for golden delicious apples based on surface features. Inf. Process. Agric. 2017, 4, 33–40. [Google Scholar] [CrossRef] [Green Version]
  10. Li, Q.Z.; Wang, M.H.; Gu, W.K. Computer vision based system for apple surface defect detection. Comput. Electron. Agric. 2002, 36, 215–223. [Google Scholar] [CrossRef]
  11. Yu, Y.; Velastin, S.A.; Yin, F. Automatic grading of apples based on multi-features and weighted K-means clustering algorithm. Inf. Process. Agric. 2020, 7, 556–565. [Google Scholar] [CrossRef]
  12. Zhang, Z.; Lu, Y.; Lu, R. Development and evaluation of an apple Infield grading and sorting system. Postharvest Biol. Tec. 2021, 180, 111588. [Google Scholar] [CrossRef]
  13. Chiu, Y.-C.; Chen, C.-H. Development of on-line apple bruise detection system. Eng. Agric. Environ. Food 2017, 10, 223–232. [Google Scholar] [CrossRef]
  14. Mizushima, A.; Lu, R. Cost benefits analysis of in-field presorting for the apple industry. Appl. Eng. Agric. 2011, 27, 33–40. [Google Scholar] [CrossRef]
  15. ElMasry, G.; Wang, N.; Vigneault, C.; Qiao, J.; ElSayed, A. Early detection of apple bruises on different background colors using hyperspectral imaging. LWT-Food Sci. Technol. 2008, 41, 337–345. [Google Scholar] [CrossRef]
  16. Zhang, Z.; Pothula, A.K.; Lu, R. A review of bin filling technologies for apple harvest and postharvest handling. Appl. Eng. Agric. 2018, 34, 687–703. [Google Scholar] [CrossRef]
  17. Dhakshina Kumar, S.; Esakkirajan, S.; Bama, S.; Keerthiveena, B. A microcontroller based machine vision approach for tomato grading and sorting using SVM classifier. Microprocess. Microsy. 2020, 76, 103090. [Google Scholar] [CrossRef]
  18. Arakeri, M.P.; Lakshmana. Computer vision based fruit grading system for quality evaluation of tomato in agriculture industry. In Proceedings of the 7th International Conference on Communication, Computing and Virtualization, ICCCV 2016, Mumbai, India, 26–27 February 2016; pp. 426–433. [Google Scholar]
  19. Hu, Z.; Tang, J.; Zhang, P.; Jiang, J. Deep learning for the identification of bruised apples by fusing 3D deep features for apple grading systems. Mech. Syst. Signal Pr. 2020, 145, 106922. [Google Scholar] [CrossRef]
  20. Barnes, M.; Duckett, T.; Cielniak, G.; Stroud, G.; Harper, G. Visual detection of blemishes in potatoes using minimalist boosted classifiers. J. Food. Eng. 2010, 98, 339–346. [Google Scholar] [CrossRef] [Green Version]
  21. Ireri, D.; Belal, E.; Okinda, C.; Makange, N.; Ji, C. A computer vision system for defect discrimination and grading in tomatoes using machine learning and image processing. Appl. Eng. Agric. 2019, 2, 28–37. [Google Scholar] [CrossRef]
  22. Sa’ad, F.S.A.; Ibrahim, M.F.; Shakaff, A.Y.M.; Zakaria, A.; Abdullah, M.Z. Shape and weight grading of mangoes using visible imaging. Comput. Electron. Agr. 2015, 115, 51–56. [Google Scholar] [CrossRef]
  23. Ji, Y.; Zhao, Q.; Bi, S.; Shen, T. Apple Grading Method Based on Features of Color and Defect. In Proceedings of the 2018 37th Chinese Control Conference (CCC), 25–27 July 2018; pp. 5364–5368. [Google Scholar]
  24. Masoumi, A.A.; Kalhor, M.; Shafaei, S.M. Design, construction and evaluation of an automatic apple grading system. Agric. Eng. Int. CIGR J. 2015, 17, 247–254. [Google Scholar]
  25. Toylan, H.; Kuscu, H. A Real-Time Apple Grading System Using Multicolor Space. Sci. World J. 2014, 2014, 292681. [Google Scholar] [CrossRef] [PubMed]
  26. Pourdarbani, R.; Ghassemzadeh, H.R.; Seyedarabi, H.; Nahandi, F.Z.; Vahed, M.M. Study on an automatic sorting system for Date fruits. J. Saudi Soc. Agric. Sci. 2015, 14, 83–90. [Google Scholar] [CrossRef] [Green Version]
  27. Arun Kumar, R.; Rajpurohit, V.S. Wavelet features for pomegranate sorting using machine vision. In Proceedings of the Innovations in Computer Science and Engineering, Singapore, 22–24 February 2019; pp. 179–186. [Google Scholar]
  28. Huang, C.; Fei, J. Online apple grading based on decision fusion of image features. Trans. CSAE 2017, 33, 285–291. [Google Scholar] [CrossRef]
  29. Sadegaonkar, V.D.; Wagh, K.H. Automatic sorting using computer vision & image processing for improving apple quality. Int. J. Innov. Res. Dev. 2015, 4, 156–163. [Google Scholar]
  30. Vakilian, K.A.; Massah, J. An apple grading system according to european fruit quality standards using gabor filter and artificial neural networks. Sci. Study Res. Chem. Chem. Eng. Biotechnol. Food. Ind. 2016, 17, 75–85. [Google Scholar]
  31. Li, A.K.; Pant, D. Automatic apple grading model development based on back propagation neural network and machine vision, and its performance evaluation. AI Soc. 2015, 30, 45–56. [Google Scholar] [CrossRef]
  32. Zhang, Z. A flexible new technique for camera calibration. IEEE Trans. Pattern Anal. Mach. Intell. 2000, 22, 1330–1334. [Google Scholar] [CrossRef] [Green Version]
  33. Chen, Y.; Zhang, J.; Li, W.; Ren, Y.; Tan, Y. Grading method of apple by maximum cross-sectional diameter based on computer vision. Trans. CSAE 2012, 28, 284–288. [Google Scholar] [CrossRef]
  34. Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.-Y.; Berg, A.C. SSD: Single Shot MultiBox Detector. In Proceedings of the Computer Vision—ECCV 2016, Cham, Switerland, 11–14 October 2016; pp. 21–37. [Google Scholar]
  35. Girshick, R. Fast R-CNN. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Santiago, Chile, 27 September 2015; pp. 1440–1448. [Google Scholar]
Figure 1. (a) Schematic diagram of the apple field grading device: 1. guiding baffle, 2. conveyor belt, 3. direction-adjusting brush, 4. industrial camera, 5. illumination source, 6. photoelectric sensor, 7. actuating push plate, 8. collection pipeline, 9. collection box, 10. wheels, 11. computer; (b) schematic diagram of the installation position of the industrial camera.
Figure 1. (a) Schematic diagram of the apple field grading device: 1. guiding baffle, 2. conveyor belt, 3. direction-adjusting brush, 4. industrial camera, 5. illumination source, 6. photoelectric sensor, 7. actuating push plate, 8. collection pipeline, 9. collection box, 10. wheels, 11. computer; (b) schematic diagram of the installation position of the industrial camera.
Horticulturae 07 00276 g001
Figure 2. Workflow of the apple field grading equipment.
Figure 2. Workflow of the apple field grading equipment.
Horticulturae 07 00276 g002
Figure 3. The statistics of the hue of the apple image in the HSV space. (a) The statistics of hue in red parts, (b) the statistics of hue in yellow parts, (c) the statistics of hue in background.
Figure 3. The statistics of the hue of the apple image in the HSV space. (a) The statistics of hue in red parts, (b) the statistics of hue in yellow parts, (c) the statistics of hue in background.
Horticulturae 07 00276 g003
Figure 4. Architecture of SSD [34].
Figure 4. Architecture of SSD [34].
Horticulturae 07 00276 g004
Figure 5. Field test of the apple grading equipment.
Figure 5. Field test of the apple grading equipment.
Horticulturae 07 00276 g005
Figure 6. Extraction of the apple perimeter.
Figure 6. Extraction of the apple perimeter.
Horticulturae 07 00276 g006
Figure 7. Extraction of the apple’s long axis in the HSV color space.
Figure 7. Extraction of the apple’s long axis in the HSV color space.
Horticulturae 07 00276 g007
Figure 8. Results of surface defect detection. (a) Apples with one kind of surface defect, (b) apples with two kinds of surface defects.
Figure 8. Results of surface defect detection. (a) Apples with one kind of surface defect, (b) apples with two kinds of surface defects.
Horticulturae 07 00276 g008
Table 1. Standard for apple grading.
Table 1. Standard for apple grading.
GradeSize/mmColor/%ShapeSurface Defect
First grade≥75≥80GoodNone
Second grade60~75≥55Slight shape distortionMild
Other grades<60<55Strong shape distortionSevere
Table 2. Statistical results of apple surface defects (number of apples).
Table 2. Statistical results of apple surface defects (number of apples).
Total Number of ApplesNo DefectsBruisingCracks and SplitsDamage Caused by Farm ChemicalsFruit RustSunburnOther Defects
10008785221159520
Table 3. Comparison of the measured and image-based results of the apple size.
Table 3. Comparison of the measured and image-based results of the apple size.
Sample NumberDiameter Obtained from the Image/mmManually Measured Diameter/mmAccuracy/%
175.676.399.37
279.378.899.51
382.082.499.42
468.969.399.19
573.674.298.97
688.487.598.13
773.474.898.84
878.577.698.77
980.081.099.16
1083.783.099.04
Table 4. Comparison of the measured and image-based results of the shape index.
Table 4. Comparison of the measured and image-based results of the shape index.
Sample NumberShape Index Obtained from the ImageShape Index Based on MeasurementsAccuracy/%
10.950.9397.85
20.830.83100.00
30.990.9595.79
40.870.9096.67
50.850.8698.84
60.900.8998.88
71.010.9795.88
80.940.9297.83
90.920.8996.63
100.790.8098.75
Table 5. Comparison of the manual grading and image-based grading results based on the apple color (number of apples).
Table 5. Comparison of the manual grading and image-based grading results based on the apple color (number of apples).
Color GradeManual Grading Correct Image-Based Grading Errors
First grade63612
Second grade26260
Other grades11110
Table 6. Statistical results of the features of the apple samples.
Table 6. Statistical results of the features of the apple samples.
FeaturesMinimumMaximumMean ± SD
Fruit diameter (mm)62.3393.9679.98 ± 5.15
Red area ratio0.630.960.83 ± 0.04
Roundness0.830.970.90 ± 0.02
Fruit shape index0.681.010.86 ± 0.04
Table 7. Manual and image-based grading (SVM) results of the apples using multiple features.
Table 7. Manual and image-based grading (SVM) results of the apples using multiple features.
Grade of AppleCorrect Image-Based Grading (Number)Manual Grading (Number)Error (Number)Accuracy (%)
First grade1912021194.55
Second grade2682801295.71
Other grades28280100
Total4875102395.49
Table 8. Manual and image-based grading results (SVM) of the apples using multiple features in the field test.
Table 8. Manual and image-based grading results (SVM) of the apples using multiple features in the field test.
Grade of AppleCorrect Image-Based Grading (Number)Manual Grading (Number)Error (Number)Accuracy (%)
First grade6974593.24
Second grade8287594.25
Other grades990100.00
Total1601701094.12
Table 9. Comparison of features and efficiency for performing apple grading.
Table 9. Comparison of features and efficiency for performing apple grading.
FeaturesAccuracy of GradingGrading RateWorking ConditionsReference
Size, defeat area, fruit shape, color degree, texture, and color distribution95%4 apples/s-[28]
Size, color, external defects, and weight96%-Indoor[31]
External defects, size, and soluble solids of apple94%0.71 s per appleIndoor[8]
Textural: image’s luminous intensity and contrast92%--[30]
Size, weight, rot area89.71%2.89 s per appleInfield[2]
Size, color, shape, and surface defects94.12%1.5 s per appleInfieldThis study
Note: -, not specified.
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Hu, G.; Zhang, E.; Zhou, J.; Zhao, J.; Gao, Z.; Sugirbay, A.; Jin, H.; Zhang, S.; Chen, J. Infield Apple Detection and Grading Based on Multi-Feature Fusion. Horticulturae 2021, 7, 276. https://0-doi-org.brum.beds.ac.uk/10.3390/horticulturae7090276

AMA Style

Hu G, Zhang E, Zhou J, Zhao J, Gao Z, Sugirbay A, Jin H, Zhang S, Chen J. Infield Apple Detection and Grading Based on Multi-Feature Fusion. Horticulturae. 2021; 7(9):276. https://0-doi-org.brum.beds.ac.uk/10.3390/horticulturae7090276

Chicago/Turabian Style

Hu, Guangrui, Enyu Zhang, Jianguo Zhou, Jian Zhao, Zening Gao, Adilet Sugirbay, Hongling Jin, Shuo Zhang, and Jun Chen. 2021. "Infield Apple Detection and Grading Based on Multi-Feature Fusion" Horticulturae 7, no. 9: 276. https://0-doi-org.brum.beds.ac.uk/10.3390/horticulturae7090276

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop