Next Article in Journal
Soybean (Glycine max (L.) Merr.) Yield Reduction due to Late Sowing as a Function of Radiation Interception and Use in a Cool Region of Northern Japan
Next Article in Special Issue
Main Motivational Factors of Farmers Adopting Precision Farming in Hungary
Previous Article in Journal
The Characterization of 10 Spring Camelina Genotypes Grown in Environmental Conditions in North-Eastern Poland
Previous Article in Special Issue
Estimating Canopy Parameters Based on the Stem Position in Apple Trees Using a 2D LiDAR
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Identification of Cabbage Seedling Defects in a Fast Automatic Transplanter Based on the maxIOU Algorithm

College of Engineering, China Agricultural University, Beijing 100083, China
*
Author to whom correspondence should be addressed.
Agronomy 2020, 10(1), 65; https://doi.org/10.3390/agronomy10010065
Submission received: 3 December 2019 / Revised: 27 December 2019 / Accepted: 27 December 2019 / Published: 2 January 2020
(This article belongs to the Special Issue Precision Agriculture)

Abstract

:
The automatic identification of seedling defects is an important technology of an intelligent automatic transplanting machine, which effectively improves the quality of the transplanting machine’s operation. The accurate segmentation of seedling substrate and seedling region is the key to the success of the seedling defect recognition algorithm. This paper proposes the maxIOU algorithm to calculate the image segmentation threshold: The image G channel and excess green color space were selected as the color space for the segmentation of the substrate region and seedling region by analyzing the color histogram. Several images were randomly selected from the dataset to generate a training set and were labeled manually as the ground truth. The training set images were segmented using a threshold of zero to 255, and the intersection over union (IOU) were calculated using the algorithm segmented result and the ground truth. The threshold corresponding to the average IOU maximum was used as the segmentation threshold. After image segmentation, three features (area of the substrate, area of the seedling, and filling ratio of the lower part of the substrate) were obtained by the algorithm, and the image was identified for whether there was an empty conveyor belt, seedling deficiency, multiple seedlings, skew, and damaged substrate. The algorithm was tested on the automatic transplanter test platform. The experiment results were as follows: Firstly, the image segmentation threshold was calculated by the maxIOU method. The color component interval corresponding to the segmented substrate region was [0, 24] in the G channel, and the color component interval corresponding to the segmented seedling region was [21, 255] in the excess green channel. The average IOU of the substrate area was 0.854, and the average IOU of the seedling area was 0.820 in the verification experiment. Secondly, a dataset including 431 normal seedling images and 69 defective seedling images (empty conveyor belt, seedling deficiency, multiple seedlings, skew, and damaged substrate) was identified for defects. The accuracy, precision, and recall were 97.6%, 97.4%, and 99.8%. The processing time was 71.4 ms. The conclusion of the experiment was as follows: the maxIOU algorithm had high accuracy in the segmentation of the substrate and seedling region. The defect identification algorithm had high accuracy for defect identification of cabbage seedlings, and the algorithm had good real-time performance, which can be applied to high speed field transplanters.

1. Introduction

Precision agriculture is the trend of modern agriculture development. The promotion of automatic transplanting machines has improved agricultural efficiency and reduced agricultural production costs. It is an important embodiment of precision agriculture. The seedling defects seriously reduce the operation effect of the transplanting machine. Automatic identification and compensation technology for defective seedlings comprise an important engineering technique to improve the pass rate of mechanized transplanted seedlings. The automatic identification technology of defect seedlings is affected by unfavorable factors such as an unstructured transplanting environment and seedling morphology, which leads to identifiable defect types, causing the recognition accuracy and algorithm processing time to not be able meet the production requirement. The difficulty of the defect seedling identification algorithm lies in accurately segmenting seedlings from the image with huge differences in the unstructured transplanting environment and identifying them with appropriate features.
In recent years, the research on defect seedling identification technology included seedling information acquisition technology [1,2,3], seedling and background segmentation [4,5], and seedling defect identification technology [6,7,8]. Advanced technologies such as hyperspectral image sensors, near-infrared image sensors, machine learning techniques, and artificial neural network technologies have played an important role. Cheng [5] proposed a color image segmentation algorithm based on principal component analysis (PCA) and the variance (CV) model, which realized the extraction of corn seedling targets under a complex background. Liao [9] proposed a rice seedling segmentation algorithm based on the YCrCb color space (a color space where the Y channel means luminance, Cr means the difference between the R channel in the RGB color space and the Y channel, and Cb means the difference between the B channel in the RGB color space and the Y channel) and an improved Otsu method. The probability parameters were used to weight the background variance of the intra-class variance to improve the accuracy of the image segmentation algorithm for the bimodal and near-single peak histogram image. Li [10] proposed a cooperative segmentation algorithm based on the Markov random field optimization model to realize automatic segmentation of cotton leaves under natural lighting conditions. Wang [11] used the threshold segmentation method, region growing segmentation method, and region segmentation method to segment the pre-processed corn images and proposed a scoring based image processing effect evaluation method. Caicedo [12] used deep learning and traditional image processing algorithms to identify nuclei. The researchers proposed an algorithm evaluation framework that used measurement accuracy, error types, and computational efficiency as indicators and publicly released 23,165 manually annotated kernels and source code sets. The test results showed that: deep learning improved accuracy and could reduce the number of biologically relevant errors by half. Rodriguez-Lozano [13] proposed a simple and novel method to segment the forehead region and to extract the average temperature from this area solving this lack of non-user interaction tools. The results provided an accuracy of 90% compared to the manual segmentation using the coefficient of Jaccard as a metric of similitude. Moreover, the method could work with real-time constraints at 83 frames per second in embedded systems with low computational resources.
Segmentation of seedlings and background is one of the key steps to achieve defect seedling identification. Threshold segmentation is the most common method of image segmentation. It is divided into the artificial threshold and automatic threshold [14,15,16,17,18] according to the threshold selection method. The automatic threshold algorithm has better adaptability to the interference factors in the image, while the artificial threshold algorithm has advantages in robustness and algorithm time consumption. Chang [19] proposed an improved Otsu threshold segmentation method based on the resampling technique and ensemble learning technology, which was more accurate than the traditional Otsu method to extract blood vessels from MRA (magnetic resonance angiography) images. Based on the basic one-dimensional Otsu algorithm, Shao [20] proposed an improved two-dimensional multi-threshold method to achieve accurate segmentation of high temperature regions in the infrared image of petrochemical pipelines. Zhan [21] proposed an ore image segmentation algorithm based on the histogram accumulation moment, which realized the ore target location and recognition of multiple scenes. Qin [22] proposed an improved ant colony algorithm and applied it to the Otsu multi-threshold segmentation algorithm. Compared with the traditional Otsu algorithm and the traditional ant colony algorithm based Otsu algorithm, the new algorithm could get the optimal threshold faster and more accurately.
In this article, an algorithm, called maxIOU, which determines the optimal segmentation threshold by calculating the maximum intersection over union (IOU) between the image processing algorithm and the artificial image segmentation result, is proposed and used to segment the substrate and seedling region from the image. Then, the area of the substrate, the area of the seedling, and the filling of the lower part of the substrate were used as three characteristic indicators to determine whether the image contained defects or not.

2. Materials and Methods

2.1. Experimental Site and Cabbage Cultivars

The test images in our paper were collected from the underground laboratory of the College of Engineering, China Agricultural University, which is located in Beijing, China (40.00° N, 116.35° E). The cabbage seedlings (Zhonggan No. 21) were selected as the experimental samples. The seedlings were planted in a standard 72 point tray. The height of the seedlings was 10–15 cm, and the number of euphyllia was 4–7. The height of seedling substrates was 3 cm, and the upper and lower surface areas of the seedling substrate were 3 × 3 cm and 1.5 × 1.5 cm.

2.2. Image Acquisition

The transplanter is shown in Figure 1. The transplanter used the ejector rod to eject the entire row of seedlings from the tray into the conveyor belt. An automatic image acquisition and processing system captured and analyzed seedling images on the conveyor. The system consisted of three parts: an industrial camera, a pair of broad area linear arrays, and an IPC (industrial personal computer). The cabbage seedling images were obtained using a MER-131-75GC network camera (Daheng Imaging, Beijing, China) with a network port. The focal length of the camera lens was 8 mm. The camera was mounted on a camera support at 0.3 m above the conveyor belt of the automatic transplanter (see Figure 1A). The exposure time was 0.5 ms. The device used a lamp house to block the incoming light and filled it with a strip light source. The light source (Daheng Imaging) was a pair of white strip light sources. The obtained images were transmitted to the computer through a gigabit network line and were saved as 24 bit color images in the RGB color space with the BMP format. The resolution of the original images was 1280 × 1024. Each image contained five cabbage seedlings, and the images of the middle three cabbage seedlings were clipped. The size of the clipped image was 265 × 1024. Finally, a dataset of 500 images was generated.

2.3. Color Space Analysis

The necessary pre-step for defect identification is to segment the two parts of the seedling accurately: the substrate and the seedlings. Image segmentation methods include threshold segmentation [23,24], edge detection segmentation [25,26], clustering algorithm segmentation [27,28], mathematical morphology based segmentation, and semantic segmentation [29,30]. In the images collected on the conveyor belt, there were interference factors such as reflection, shadow, and substrate debris and the morphological differences of cabbage seedlings were large. Edge detection and clustering algorithms were not applicable. Semantic segmentation based on a full convolutional neural network can be applied to the extraction of complex targets; however, sample labeling is too cumbersome, and the algorithm is not real time. The threshold segmentation algorithm is a segmentation algorithm suitable for fixed backgrounds and known foreground target colors. The algorithm is stable and real time. The mathematical morphology algorithm is a supplement to the image segmentation algorithm, mainly used to remove noise points. Therefore, the combination of threshold segmentation and the mathematical morphology algorithm was selected to segment the matrix blocks and seedlings.
The implementation of the threshold segmentation algorithm depends on the appropriate color space. In this article, a grayscale histogram was used to determine the color space. Image color spaces include RGB, HSV, YIQ, etc. (see Figure 2). The color histogram peak feature analysis method was used to determine the image segmentation color space: Ten images of cabbage seedlings were randomly selected and converted into the RGB, HSV, and YIQ spaces respectively. Then, each color space gray histogram was accumulated (see Figure 3). As is shown in Figure 2(A1–A3) and Figure 3A, three channels of the RGB space showed peak characteristics, wherein the green channel peak characteristics of the G green channel were the most stable and the peak region corresponded to the substrate region. As is shown in Figure 2(B1–B3) and Figure 3B, among the three channels of the HSV space, the S channel showed peak characteristics, but the peak area corresponded to the background area. As is shown in Figure 2(C1–C3) and Figure 3C, neither of the three channels in the YIQ space showed a peak corresponding to the substrate region. Therefore, the RGB space G channel was selected as the color space for substrate segmentation.
The excess green color space (see Equation (1)) is commonly used in green target segmentation. The color component of the seedling area in the sample image was significantly higher than other areas (see Figure 4 and Figure 5), and the threshold segmentation method could realize the segmentation of seedling regions. Therefore, the excess green color space was used to segment the seedling area.
ExG = { 0 2 G B R < 0 2 G B R 0 < 2 G B R < 255 255 2 G B R > 255 .
where R, G, and B are the pixel values in the RGB color space. ExG is the pixel value in the excess green color space.

2.4. Segmentation Threshold Calculated by the maxIOU Algorithm

This section analyzes the algorithm for image segmentation threshold calculation. Traditional image segmentation threshold calculation methods, such as the Otsu method and the gray histogram method, are applicable to double peak image segmentation. Although the G channel of the sample image had double peaks, the double peaks contained more background pixel interference, and the segmentation threshold obtained by the Otsu method was not accurate enough (see Figure 3A). The valley region between the double peaks of the image G channel was too wide (see Figure 3A), and the gray histogram method also had difficult searching for a suitable segmentation threshold. The seedling area did not form double peaks in the super green color space (Figure 5) and was not suitable for the Otsu method and the gray histogram method.
In this article, the maxIOU algorithm is proposed (Equation (2)), which could be used to calculate the image segmentation threshold with an inconspicuous double peak feature. The maxIOU method drew on the idea of the Otsu method enumerating all segmentation threshold comparison effects, but made two important improvements:
(1) Inter-class variance was replaced by intersection over union (IOU) as a function for evaluating the image segmentation effect.
(2) The threshold corresponding to the maximum average IOU of the training set image was used as the image segmentation threshold instead of the Otsu adaptive threshold.
threshold = i   if   IOU i = max ( IOU )
where IOU is the intersection over union of algorithm segmented image and labeled image; i is the color component between 0 and 255.
maxIOU was applied to segment the substrate and seedling region. Firstly, several images were selected as Training Set 1 from the dataset. The substrate region and the seedling region of the image were manually segmented and labeled as the ground truth. Secondly, all training set images in the G channel and excel green color space were segmented with a 0–255 threshold and were repaired by morphological methods. IOU was calculated with the algorithm segment result and ground truth. Finally, the average value of the IOU corresponding to each threshold was calculated, and the maximum average IOU corresponding threshold was selected as the image segmentation threshold.
IOU is a standard for measuring the accuracy of detecting corresponding objects in a specific dataset. The IOU is a number between 0 and 1, and a larger IOU indicates a better segmentation result. The IOU calculation method is shown in Figure 6 and Equation (3).
C1 is the artificial labeled image segmentation result, which is called the ground truth. C2 is the image segmentation result by the algorithm. Si is the shadow in Figure 6A, which is the intersection of C1 and C2. Su is the shadow in Figure 6B, which is the union of C1 and C2.
IOU = S i S u
The original images and the artificially labeled substrate area and seedling area images are shown in Figure 7 and the corresponding G channel, and excess green color space gray histogram are shown in Figure 8. As is shown in Figure 8(A3,B3), the gray histogram of the artificially labeled substrate region had a peak coincidence with the gray histogram of the complete image in the G channel, and the overlap interval was [0, selected threshold]. Therefore, it was feasible to use the threshold segmentation method to achieve the segmentation of the substrate region and the background region. As is shown in Figure 8(C3,D3), the grayscale histogram of the artificially labeled seedling region had a higher degree of coincidence with the higher color component of the grayscale histogram of the complete image. Therefore, it was feasible to use the threshold segmentation method to realize the segmentation of the seedling area and background area.
As is shown in Figure 8, the segmentation result of the threshold segmentation algorithm was partially misjudged because of the interference of the broken substrate, vermiculite, and shadow. Image segmentation results needed to be repaired using morphological algorithms. The morphological algorithms used in this paper included dilation (see Equation (4)), blob analysis (see Equation (5)), and area filling surrounded by convex hull points [31,32] (see Equation (6)).
D ( x , y ) = { 1 A B 0 A B =
where A is the object to be dilated; B is the dilated structural element; D(x,y) is the center of the structural element. The image was convolved using the dilated structural element as the convolution mask and be converted to a dilated image.
B = { t r u e                 A > T f a l s e               A < T
where A is the area of the connected domain; T is the threshold for connected domain selection; B is the output of blob analysis. If the area of a connected domain is greater than the threshold, the connected domain will be preserved, otherwise the connected domain will be removed.
b o o l i = { t r u e P s P i × P s 1 P s 0 f a l s e P s P i × P s 1 P s < 0
where booli indicates whether point Pi is a convex hull point; the minimum row coordinate point in the region edge points is selected as base point P0, and other points are sorted from small to large at the angle of the line vector with P0 and recorded as Pi; P0 and P1 are the default as the convex hull points; Ps is the previous convex hull point of Pi; Ps−1 is the previous two convex hull points of Pi.

2.5. Identification of Seedling Defects

Seedling defects are inevitable in automatic transplanter operations. Seedling defects that may occur during ram-type transplanters’ operation include the following: empty conveyor belt, seedling deficiency, skew, multiple seedlings, and substrate damage (see Figure 9 and Table 1 and Table 2).
After the segmentation of substrate and seedling area, the region area was selected as an indicator to evaluate whether the image had the defects of empty conveyor belt, seedling deficiency, skew, and multiple seedlings. The area of the normal image substrate area should be larger than the area of the empty conveyor belt, seedling deficiency, and skew image substrate area and smaller than the area of the multiple seedlings image substrate area. Therefore, the upper threshold and the lower threshold (see Equation (7)) can be used to identify whether or not there is a defect in the image.
b o o l 1 = { t r u e area se > threshold sed and threshold sud < area su < threshold suu f a l s e e l s e
where arease is the area of seedling region; areasu is the area of the substrate region; thresholdsed is the seedling area lower threshold; thresholdsud and thresholdsuu are the substrate region lower threshold and upper threshold.
The defect of substrate damage needs to be identified by area shape analysis. The complete substrate is trapezoidal in shape and is consistent with the groove, while the damaged substrate is rectangular in shape and fills the entire conveyor belt slot. The following method is used to determine whether the substrate is damaged (see Figure 10 and Equation (8)): The substrate is equally divided into upper and lower parts by a 1/2 substrate height. The area of the lower part (A-1,B-1) and the outer frame area is calculated, and the ratio of lower part area to the frame area is recorded as c to determine whether the substrate is damaged (see Equation (9)).
c = a r e a d a
where c is the index for evaluation of whether the substrate is damaged; aread is the area of the lower part of the substrate; a is the area of the outer frame.
b o o l 2 = { t r u e c d < c < c u f a l s e e l s e
where cu is the index c upper threshold; cd is the index c lower threshold.
In this article, the method of feature scatter plot analysis was used to obtain the optimal defect identification threshold. Some of the sample images were randomly selected as Training Set 2 and manually labeled as the normal group and defect group, including the defects of the empty conveyor belt, seedling deficiency, skew, multiple seedlings, and substrate damage. The image processing method was used to calculate the feature values of the image: arease, areasu (Formula (8)), and c (Formula (9)). Feature scatter plots were used to analyze the normal and defect group sample characteristics, and the threshold with the highest classification accuracy rate was used as the defect identification threshold.

2.6. Identification of Cabbage Seedling Defects Procedure

In this subsection, the detailed steps of the proposed algorithm for identification of cabbage seedling defects are described:
  • Step 1: Some images were randomly selected as Training Set 1 from the dataset and manually labeled as the substrate and seedling region.
  • Step 2: The RGB color space G channel and the excel green color space (Formula (1)) of Training Set 1 were used as the image segmentation color space.
  • Step 3: The images in Training Set 1 were segmented using a threshold of 0–255 and morphologically repaired. IOU was calculated with image segmentation results and labelled images. The threshold corresponding to the maximum IOU was the segmentation threshold.
  • Step 4: Some of the images in the dataset were randomly selected as Training Set 2 and manually labeled as the normal group and defect group (including the defects of empty conveyor belt, seedling deficiency, skew, multiple seedlings, and substrate damage).
  • Step 5: The image processing method was used to calculate the feature values of the image: arease, areasu (Equation (8)), and c (Equation (9)). Feature scatter plots were used to analyze normal and defect group sample characteristics, and the threshold with the highest classification accuracy rate was used as the defect identification threshold.
  • Step 6: Identification of cabbage seedling defects: The images in the G channel and excess green color space were segmented with the threshold obtained in Step 3. The values of arease, areasu (Equation (8)), and c (Equation (9)) were calculated, and cabbage seedling defects were identified based on the threshold calculated in Step 5.

3. Experimental Results and Discussion

3.1. Image Segmentation Threshold Calculation and Result Analysis

In this section, the optimal threshold for matrix and seedling region segmentation is obtained by experimental methods. From the dataset consisting of 500 images, 10 images were randomly selected as Training Set 1, and the image segmentation threshold was calculated using the maxIOU method. The experiment result is shown in Figure 11A,B: The maximum IOU of the substrate region was 0.873, and the corresponding segmentation threshold was 24. The maximum IOU of the seedling region was 0.790, and the corresponding segmentation threshold was 21. Combined with the analysis in Section 2.4 (see Figure 7 and Figure 8), the color component interval corresponding to the segmented substrate region was [0, 24] in the G channel, and the color component interval corresponding to the segmented seedling region was [21, 255] in the excess green color space.
A verification experiment was designed to verify the generalization performance of the maxIOU method. Fifty images that were different from Training Set 1 were randomly selected from the dataset to verify the algorithm’s segmentation effect. The segmentation threshold calculated in the previous paragraph was used to segment the images. The experiment result is shown as follows: The average IOU of the substrate area was 0.854, and the average IOU of the seedling area was 0.820. Image segmentation results are shown in Figure 12. The experiment obtained the conclusion that the thresholds searched by the maxIOU method could well achieve the segmentation of the substrate and seedling region.

3.2. Defect Identification Threshold Calculation and Result Analysis

Firstly, some images were selected from the dataset to calculate the defect identification threshold. Two-hundred normal seedling images were randomly selected from the dataset as the normal group, and 25 defective seedling images were selected as the defect group, including 5 empty conveyor belt images, 5 seedling deficiency images, 5 skew images, 5 multiple seedlings images, and 5 substrate damage images.
According to Equation (7), a scatter plot was used to determine the lower threshold of seedling area (see Figure 13). According to the defect feature analysis in Table 2, the empty belt, lack of seedlings, and skewed seedling images were selected for comparison with the normal group images. The area minimum of the normal group seedlings was 19,275 pixels, followed by 29,230 pixels. The area maximum of the empty belt, lack of seedlings, and skewed seedling was 23,688, followed by 18,806. The classification results of different segmentation thresholds are shown in Table 3. As shown in Table 3, when the classification threshold interval was (18,806, 19,275), there was one misclassification in the empty conveyor belt images, while the seedling deficiency, skew, and normal images were all classified correctly. When the classification threshold interval was (19,275, 23,688), there was one error respectively in the normal images and the defect images’ (empty conveyor belt, seedling deficiency, and skew images) classification result. When the classification threshold interval was (23,688, 29,230), there was one misidentification in normal images’ classification, and the defect images (empty conveyor belt, seedling deficiency, and skew images) were all classified correctly. As the effect of defect seedling misidentification was greater than normal seedling misidentification, the seedling defect identification threshold interval should be selected as (23,688, 29,230). Finally, the threshold was taken as the intermediate value of 26,459 in the experiment.
According to Equation (7), a scatter plot was used to determine the upper and lower threshold of the seedling area (see Figure 14). According to the defect feature analysis in Table 2, the empty conveyor belt, multiple seedlings, and substrate damaged images were selected for comparison with the normal images. The area maximum of the normal group substrate was 46,912 pixels, and the area minimum of the normal group substrate was 21,888 pixels. The area maximum of the multiple seedlings and substrate damaged images was 51,931 pixels. All the area of the empty conveyor belt images was zero. There was no overlapping interval between the normal group and the defect images. The substrate identification lower threshold interval was selected as (0, 21,688), and the upper threshold interval was selected as (46,912, 57,931). Finally, the lower and upper threshold were taken as the intermediate values of 10,844 and 52,422 in the experiment.
According to Equation (9), a scatter plot was used to determine the threshold of the c value of the substrate’s lower part (see Figure 15). The c value maximum of the normal group images was 0.661, and the c value minimum of the substrate damaged images was 0.688. There was no overlapping interval between the normal group and the substrate damaged images. The c value threshold interval was selected as (0.661, 0.688). Finally, the c value threshold was taken as the intermediate value of 0.675 in the experiment.

3.3. The Result of Seedling Defects’ Identification

Finally, all images in the dataset were analyzed for defects. The experiment was implemented on an HP PC with an Intel Core-i7 processor and 8 GB RAM. In the experiment, the original image with a size of 265 × 1024 shown in Figure 2I was selected as the test image. The algorithm was written in the Halcon library. All pictures in the dataset were image segmented using the thresholds calculated above, and the corresponding features were identified for defects. The experiment result is shown in Table 4.
Accuracy (see Equation (10)), precision (see Equation (11)), and recall (see Equation (12)) were used as indicators for analyzing the effect of defect identification. The analysis result is shown in Table 5. The normal images were taken as positive samples, and the defective seedling images were taken as negative samples.
a c c u r a c y = T P + T N T P + T N + F P + F N
p r e c i s i o n = T P T P + F P
r e c a l l = T P T P + F N
where TP is the number of positive samples that are correctly identified; TN is the number of negative samples that are correctly identified; FP is the number of positive samples that are misidentified; FN is the number of negative samples that are misidentified.
The experiment analysis indicated that: the accuracy was 97.6%; the precision was 97.4%; the recall was 99.8%; and the progress time was 71.4 ms. The algorithm had good accuracy in identifying seedling defects. The defect seedling misidentification rate was extremely low (recall was 99.8%). The algorithm had good real-time performance and could be applied in high speed cabbage transplanters.

4. Conclusions

In this article, the maxIOU algorithm was proposed (Equation (4)), which could be used to calculate the image segmentation threshold with inconspicuous double peak feature. The maxIOU method drew on the idea of the Otsu method enumerating all segmentation threshold comparison effects, but made two important improvements: (1) Inter-class variance was replaced by intersection over union (IOU) as a function for evaluating the image segmentation effect. (2) The threshold corresponding to the maximum average IOU of the training set image was used as the image segmentation threshold instead of the Otsu adaptive threshold. The maxIOU method was applied in the substrate and seedling region segmentation. After image segmentation, the area of the substrate area, the area of the seedling area, and the filling ratio of the lower part of the substrate area were calculated, and the defect identification threshold was calculated using the feature scatter plot. Finally, the five defects of empty conveyor belt, seedling deficiency, multiple seedling, skew, and seedling damaged were identified by the algorithm. Based on the condition of the automatic cabbage transplanter, an experiment was designed to test the segmentation effect of the maxIOU algorithm on the substrate and seedling region and the defects’ identification result. The conclusion of the experiment is shown as follows: the maxIOU algorithm had high accuracy in the segmentation of the substrate and seedling region. The defect identification algorithm had high accuracy for defect identification of cabbage seedlings, and the algorithm had good real-time performance. which could be applied to high speed transplanters. The image acquisition system used a light box to block external light sources and used a strip light source to illuminate the field of view. Field external light does not affect field brightness. The industrial camera adopted fast exposure mode to reduce the impact of conveyor movement and mechanical vibration on image acquisition sharpness. The algorithm in this article could be well applied to the detection of defective seedlings in high speed field transplanters.

Author Contributions

All authors contributed to the research. Conceptualization, Y.T., T.Y. and J.Z.; data curation, G.Z., J.T. and Y.Z.; investigation, S.Z.; resources, Y.W.; software, G.Z.; supervision, T.Y.; validation, Y.W. and D.D.; writing, original draft, G.Z.; writing, review and editing, Y.C. All authors have read and agreed to the published version of the manuscript.

Funding

This work was funded by the High Speed Planting Technology and Equipment of Vegetable Seedlings (2017YFD0701303).

Conflicts of Interest

We declare that we do not have any commercial or associative interest that represents a conflict of interest in connection with the work submitted

References

  1. Chiu, Y.C.; Hsu, W.C.; Chang, Y.C. Detecting cabbage seedling diseases by using chlorophyll fluorescence. Eng. Agric. Environ. Food 2015, 8, 95–100. [Google Scholar] [CrossRef]
  2. Wei, D.; Huang, Y.; Chunjiang, Z.; Xiu, W. Identification of seedling cabbages and weeds using hyperspectral imaging. Int. J. Agric. Biol. Eng. 2015, 8, 65–72. [Google Scholar]
  3. Benoit, L.; Semaan, G.; Franconi, F.; Belin, É.; Chapeau-Blondeau, F.; Demilly, D.; Rousseau, D. 3D Multimodal Simulation of Image Acquisition by X-ray and MRI for Validation of Seedling Measurements with Segmentation Algorithms; Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics); Springer: Zurich, Switzerland, 2015. [Google Scholar]
  4. Lu, X.; Li, X.; Chai, Y.; Li, X. Seedling image segmentation and feature extraction under complicated background. Commun. Comput. Inf. Sci. 2014, 461, 387–399. [Google Scholar]
  5. Cheng, Y.Z.; Chen, Y. Corn seedling image segmentation using PCA and CV model. J. Comput. Inf. Syst. 2015, 11, 7825–7832. [Google Scholar]
  6. Yang, Y.; Chu, Q.; Yang, Y.; Zhang, X.; Xu, X.; Gu, S. Online grading method for tissue culture seedlings of Spathiphyllum floribundum based on machine vision. Nongye Gongcheng Xuebao Trans. Chin. Soc. Agric. Eng. 2016, 32, 33–40. [Google Scholar]
  7. Tong, J.; Shi, H.; Wu, C.; Jiang, H.; Yang, T. Skewness correction and quality evaluation of plug seedling images based on Canny operator and Hough transform. Comput. Electron. Agric. 2018, 155, 461–472. [Google Scholar] [CrossRef]
  8. Feng, Q.; Liu, X.; Jiang, K.; Fan, P.; Wang, X. Development and experiment on system for tray-seedling on-line measurement based on line structured-light vision. Nongye Gongcheng Xuebao Trans. Chin. Soc. Agric. Eng. 2013, 29, 143–149. [Google Scholar]
  9. Liao, J.; Wang, Y.; Yin, J.; Liu, L.; Zhang, S.; Zhu, D. Segmentation of rice seedlings using the YCrCb color space and an improved Otsu method. Agronomy-Basel 2018, 8, 269. [Google Scholar] [CrossRef] [Green Version]
  10. Li, K.; Feng, Q.; Zhang, J. Co-Segmentation algorithm for complex background image of cotton seedling leaves. Jisuanji Fuzhu Sheji Yu Tuxingxue Xuebao J. Comput.-Aided Des. Comput. Gr. 2017, 29, 1871–1880. [Google Scholar]
  11. Wang, X.; He, D.; Song, H. Machine vision based quantitative analysis method for seedling root system of maize images. Int. Agric. Eng. J. 2018, 27, 380–392. [Google Scholar]
  12. Caicedo, J.C.; Roth, J.; Goodman, A. Evaluation of deep learning strategies for nucleus segmentation in fluorescence images. Cytom. Part A 2019, 95, 952–965. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  13. Rodriguez-Lozano, F.J.; Leon-Garcia, F.; Ruiz De Adana, M.; Palomares, J.M.; Olivares, J. Non-Invasive forehead segmentation in thermographic imaging. Sensors 2019, 19, 4096. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  14. Fan, H.; Xie, F.; Li, Y.; Jian, Z.; Liu, J. Automatic segmentation of dermoscopy images using saliency combined with Otsu threshold. Comput. Biol. Med. 2017, 85, 75–85. [Google Scholar] [CrossRef] [PubMed]
  15. Osroosh, Y.; Peters, R.T.; Campbell, C.S.; Zhang, Q. Automatic irrigation scheduling of apple trees using theoretical crop water stress index with an innovative dynamic threshold. Comput. Electron. Agric. 2015, 118, 193–203. [Google Scholar] [CrossRef]
  16. Singla, A.; Patra, S. A fast automatic optimal threshold selection technique for image segmentation. Signal Image Video Process. 2017, 11, 243–250. [Google Scholar] [CrossRef]
  17. Ustubioglu, B.; Ulutas, G.; Ulutas, M.; Nabiyev, V.V. A new copy move forgery detection technique with automatic threshold determination. AEU–Int. J. Electron. Commun. 2016, 70, 1076–1087. [Google Scholar] [CrossRef]
  18. Gupta, V.; Chaurasia, V.; Shandilya, M. Random-valued impulse noise removal using adaptive dual threshold median filter. J. Visual Commun. Image Represent. 2015, 26, 296–304. [Google Scholar] [CrossRef]
  19. Chang, Y.C. Improving the Otsu method for MRA image vessel extraction via resampling and ensemble learning. Healthc. Technol. Lett. 2019, 6, 115–120. [Google Scholar] [CrossRef]
  20. Shao, L.; Zhang, Y.; Li, J.; Liu, H.; Chen, X.; Yu, X. Research on High Temperature Region Segmentation of Infrared Pipeline Image Based on Improved Two-Dimensional-Otsu. Spectrosc. Spectr. Anal. 2019, 39, 1637–1642. [Google Scholar]
  21. Zhan, Y.; Zhang, G. An improved OTSU algorithm using histogram accumulation moment for ore segmentation. Symmetry-Basel 2019, 11, 431. [Google Scholar] [CrossRef] [Green Version]
  22. Qin, J.; Shen, X.; Mei, F.; Fang, Z. An Otsu multi-thresholds segmentation algorithm based on improved ACO. J. Supercomput. 2019, 75, 955–967. [Google Scholar] [CrossRef]
  23. Meng, W.; Tonghai, J.; Xiao, L.; Yan, Z.; Haiwei, W. Image segmentation based on adaptive inertia weight particle swarm optimization. Revista Tecnica de la Facultad de Ingenieria Universidad del Zulia 2016, 39, 235–241. [Google Scholar]
  24. Bao, X.; Jia, H.; Lang, C. A novel hybrid harris hawks optimization for color image multilevel thresholding segmentation. IEEE Access 2019, 7, 76529–76546. [Google Scholar] [CrossRef]
  25. Ren, J.; Zeng, X. An image segmentation method of improved sobel operator. Boletin Tecnico Tech. Bull. 2017, 55, 193–199. [Google Scholar]
  26. Howard, M.; Hock, M.C.; Meehan, B.T.; Dresselhaus-Cooper, L.E. A locally adapting technique for edge detection using image segmentation. SIAM J. Sci. Comput. 2018, 40, B1161–B1179. [Google Scholar] [CrossRef]
  27. Wang, Y.; Wang, C. Computer vision-based color image segmentation with improved kernel clustering. Int. J. Smart Sens. Intell. Syst. 2015, 8, 1706–1729. [Google Scholar] [CrossRef] [Green Version]
  28. Koundal, D. Texture-based image segmentation using neutrosophic clustering. IET Image Process. 2017, 11, 640–645. [Google Scholar] [CrossRef]
  29. Shelhamer, E.; Long, J.; Darrell, T. Fully convolutional networks for semantic segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 640–651. [Google Scholar] [CrossRef]
  30. Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Region-Based convolutional networks for accurate object detection and segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2016, 38, 142–158. [Google Scholar] [CrossRef]
  31. Ding, S.; Nie, X.; Qiao, H.; Zhang, B. A fast algorithm of convex hull vertices selection for online classification. IEEE Trans. Neural Netw. Learn. Syst. 2018, 29, 792–806. [Google Scholar] [CrossRef]
  32. Zeng, M.; Yang, Y.; Zheng, J.; Cheng, J. Maximum margin classification based on flexible convex hulls for fault diagnosis of roller bearings. Mech. Syst. Signal Process. 2016, 66, 533–545. [Google Scholar] [CrossRef]
Figure 1. Image acquisition. (A) Image acquisition device; (B) experimental site.
Figure 1. Image acquisition. (A) Image acquisition device; (B) experimental site.
Agronomy 10 00065 g001
Figure 2. Experimental pictures in different color spaces. (I) the original image; (A1A3) the R, G, and B channel images in the RGB color space; (B1B3) the H, S, and V channel images in the HSV color space; (C1C3) the Y, I, and Q channel images in the YIQ color space.
Figure 2. Experimental pictures in different color spaces. (I) the original image; (A1A3) the R, G, and B channel images in the RGB color space; (B1B3) the H, S, and V channel images in the HSV color space; (C1C3) the Y, I, and Q channel images in the YIQ color space.
Agronomy 10 00065 g002
Figure 3. Gray histogram of the cabbage seedling image. (A) RGB color space gray histogram; (B) HSV color space gray histogram; (C) YIQ color space gray histogram.
Figure 3. Gray histogram of the cabbage seedling image. (A) RGB color space gray histogram; (B) HSV color space gray histogram; (C) YIQ color space gray histogram.
Agronomy 10 00065 g003aAgronomy 10 00065 g003b
Figure 4. Experimental pictures in the excess green color space. (I) The original image. (A) The image in the excess green color space.
Figure 4. Experimental pictures in the excess green color space. (I) The original image. (A) The image in the excess green color space.
Agronomy 10 00065 g004
Figure 5. Gray histogram of the cabbage seedling image in the excess green color space.
Figure 5. Gray histogram of the cabbage seedling image in the excess green color space.
Agronomy 10 00065 g005
Figure 6. The concept of the intersection over union ratio. (A) The intersection; (B) the union.
Figure 6. The concept of the intersection over union ratio. (A) The intersection; (B) the union.
Agronomy 10 00065 g006
Figure 7. The labeled substrate and seedling region. (I1,I2) The original image; (A1,B1) the labeled substrate region; (A2,B2) the cropped substrate region; (A3,B3) the labeled seedling region; (A4,B4) the cropped seedling region.
Figure 7. The labeled substrate and seedling region. (I1,I2) The original image; (A1,B1) the labeled substrate region; (A2,B2) the cropped substrate region; (A3,B3) the labeled seedling region; (A4,B4) the cropped seedling region.
Agronomy 10 00065 g007
Figure 8. Grayscale histogram analysis of the substrate and seedling region. (I1,I2) The original image; (A1,B1) the cropped substrate region in the G channel; (A2,B2) the complete image in the G channel; (A3,B3) the grayscale histogram of the cropped substrate region and the complete image in the G channel; (C1,D1) the cropped seedling region in the excess green color space; (C2,D2) the complete image in the excess green color space; (C3,D3) the grayscale histogram of the cropped seedling region and the complete image in the excess green color space.
Figure 8. Grayscale histogram analysis of the substrate and seedling region. (I1,I2) The original image; (A1,B1) the cropped substrate region in the G channel; (A2,B2) the complete image in the G channel; (A3,B3) the grayscale histogram of the cropped substrate region and the complete image in the G channel; (C1,D1) the cropped seedling region in the excess green color space; (C2,D2) the complete image in the excess green color space; (C3,D3) the grayscale histogram of the cropped seedling region and the complete image in the excess green color space.
Agronomy 10 00065 g008
Figure 9. Cabbage seedling defects.
Figure 9. Cabbage seedling defects.
Agronomy 10 00065 g009
Figure 10. Substrate segmentation. (I1) The normal cabbage seedling image; (I2) the substrate damaged cabbage seedling image; (A,B) substrate segmentation of the cabbage seedling image; (A-1,B-1) the upper part of the segmented substrate area; (A-2,B-2) the lower part of the segmented substrate area.
Figure 10. Substrate segmentation. (I1) The normal cabbage seedling image; (I2) the substrate damaged cabbage seedling image; (A,B) substrate segmentation of the cabbage seedling image; (A-1,B-1) the upper part of the segmented substrate area; (A-2,B-2) the lower part of the segmented substrate area.
Agronomy 10 00065 g010
Figure 11. Mean IOU of the substrate (A) and seedling region (B).
Figure 11. Mean IOU of the substrate (A) and seedling region (B).
Agronomy 10 00065 g011
Figure 12. Image segmentation results based on maxIOU. (AE) The original images; (A-1E-1) the segmented images. The red regions are the segmented substrate regions. The green regions are the segmented seedling regions.
Figure 12. Image segmentation results based on maxIOU. (AE) The original images; (A-1E-1) the segmented images. The red regions are the segmented substrate regions. The green regions are the segmented seedling regions.
Agronomy 10 00065 g012
Figure 13. Feature scatter plot of the seedling area.
Figure 13. Feature scatter plot of the seedling area.
Agronomy 10 00065 g013
Figure 14. Feature scatter plot of the substrate area.
Figure 14. Feature scatter plot of the substrate area.
Agronomy 10 00065 g014
Figure 15. Feature scatter plot of the c value of the substrate lower part.
Figure 15. Feature scatter plot of the c value of the substrate lower part.
Agronomy 10 00065 g015
Table 1. Seedling defect characterization.
Table 1. Seedling defect characterization.
Seedling DefectsDefects’ Characterization
Empty conveyor beltThere is no seedling on the conveyor belt
Seedling deficiencyThere is substrate on the conveyor belt, but no seedling
SkewThe stem of the seedling spans the conveyor baffle
Multiple seedlingsThere is more than 1 seedling in a conveyor belt slot
Substrate damageSerious damage to the substrate structure leads to an irregular substrate shape
Table 2. The substrate and seedling feature of cabbage seedling defects.
Table 2. The substrate and seedling feature of cabbage seedling defects.
Empty Conveyor BeltSeedling DeficiencySkewMultiple SeedlingsSubstrate Damage
SubstrateArea too small--Area too largeArea too large and area of the lower part too large
SeedlingArea too smallArea too smallArea too small--
Table 3. Analysis of the seedling defect identification threshold.
Table 3. Analysis of the seedling defect identification threshold.
Classification Threshold Interval(18,806, 19,275)(19,275, 23,688)(23,688, 29,230)
The number of misclassified normal images 011
The accuracy of normal images’ classification100%99.5%99.5%
The number of misclassified defect images (empty conveyor belt, seedling deficiency, and skew images) 110
The accuracy of defect images’ (empty conveyor belt, seedlings deficiency, and skew images) classification93.3%93.3%100%
Table 4. Experiment result.
Table 4. Experiment result.
GroupThe Total NumberThe Number of Samples Correctly Identified
Normal431420
Empty conveyor belt2020
Seedling deficiency1514
Multiple seedling66
Skew1616
Seedling damaged1212
Total500488
Table 5. Experiment analysis.
Table 5. Experiment analysis.
TPTNFPFNAccuracyPrecisionRecallProcessing Time (ms)
4206811197.6%97.4%99.8%71.4
TP is the number of positive samples that are correctly identified; TN is the number of negative samples that are correctly identified; FP is the number of positive samples that are misidentified; FN is the number of negative samples that are misidentified.

Share and Cite

MDPI and ACS Style

Zhang, G.; Wen, Y.; Tan, Y.; Yuan, T.; Zhang, J.; Chen, Y.; Zhu, S.; Duan, D.; Tian, J.; Zhang, Y. Identification of Cabbage Seedling Defects in a Fast Automatic Transplanter Based on the maxIOU Algorithm. Agronomy 2020, 10, 65. https://doi.org/10.3390/agronomy10010065

AMA Style

Zhang G, Wen Y, Tan Y, Yuan T, Zhang J, Chen Y, Zhu S, Duan D, Tian J, Zhang Y. Identification of Cabbage Seedling Defects in a Fast Automatic Transplanter Based on the maxIOU Algorithm. Agronomy. 2020; 10(1):65. https://doi.org/10.3390/agronomy10010065

Chicago/Turabian Style

Zhang, Gan, Yongshuang Wen, Yuzhi Tan, Ting Yuan, Junxiong Zhang, Ying Chen, Sishuo Zhu, Dongshuai Duan, Jinyuan Tian, and Yu Zhang. 2020. "Identification of Cabbage Seedling Defects in a Fast Automatic Transplanter Based on the maxIOU Algorithm" Agronomy 10, no. 1: 65. https://doi.org/10.3390/agronomy10010065

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