Weed Detection over Between-Row of Sugarcane Fields Using Machine Vision with Shadow Robustness Technique for Variable Rate Herbicide Applicator

: Problem statement: Uniformly herbicide rate is used as a conventional practice in Thailand for controlling weeds in sugarcane fields. Since weeds usually grow in certain areas with non-uniformly distribution, uniform herbicide rate approach is not suitable and non-sustainable agricultural technique both in terms of economic an environmental aspect. To address these issues, Variable Herbicide Rate (VHR) was introduced. The VHR composes of two main components, which are weed monitoring and real-time spraying. Approach: This study investigated with a development of a fast and robust weed monitoring system for VHR using over between-row of sugarcane fields. The proposed method was designed to work under natural illumination condition. The near-ground images were captured using a typical web camera without any assistant light diffuser. The proposed weed monitoring is a machine vision based approach. The Non Green Subtraction (NGS) technique was proposed for soil background segmentation. Results: The proposed technique exploited variations among three triplets, which are red, green and blue under bright and dull lighting condition to achieve better background segmentation results. The non-background pixels were then classified into weeds and non-weeds using the Offset Excessive Green (OEG) technique. Conclusion: From our experimental results, the proposed method is robust under illumination variations such as in sunny and after raining day conditions. Weeds under different lighting conditions are reliably detects. The approach is less sensitive to chosen threshold value comparing to the OEG technique. The proposed method is very effective especially in spare weeds condition. It is fast, suitable for using in real-time application.


INTRODUCTION
Sugarcanes play an important role in export crops business, especially in the Northeast of Thailand (Singh and Abeygoodwardana, 1982). In order to achieve high sugarcane productions, effective weed control system is essential. Conventionally, herbicides are applied uniformly in fields. However, weeds often occur in patches and are spread non-uniformly (Shaw, 2005). Hence, uniformly applied herbicides in fields increases farmer's production cost and is prone to ground water contamination. As regards to mentioned economic and environment aspect, spatial weed information and precision herbicide applicator offers high potential for farmer to fine-tune rate of herbicides.
In this study, a real-time algorithm of spatial weed detection is developed. Our approach is a sensor based using machine vision system. Field weed images are captured using web camera. A fast color-based segmentation is developed under restriction of real-time processing. Our proposed system is different from previous existing method in that it requires no assistant devices during acquiring field images. An example is Zhang et al. (2002) included additional light-blocking screen in his system to handle effects of natural light source over inspection area. To segment weeds, Slaughter et al. (2008) exploited a conventional thresholding technique on green chromatic information of the images. Mayer et al. (2004) analyzed greenness over an input image using Fuzzy excess red and excess green technique. His technique can be used to classify various types of plants. However, we focus on detecting weeds in sugarcane field for real-time application. In sugarcane fields, all vegetations in its between-row are considered as weeds. Thus, a simpler technique can be used. In our work, the Offset Excessive Green (OEG) (Naeem et al., 2007) is utilized. The OEG technique is fast and simple. However, it requires parameter tuning when image acquisition conditions are changed. The Non-green subtraction technique is proposed in this work to improve system accuracy and minimizing effects of chosen OEG threshold value.

Raw material:
The study reported here solely uses color information techniques to detect weeds in sugarcane fields. Practically, sugarcanes are grown in rows with spacing of 150 cm. in Thailand. All vegetations grow between these sugarcane rows are considered as weeds. Weed images were taken by "Logitech quick cam notebook pro" with Carl Zeiss lens (Baker, 1991). The captured images are 240×320 pixel resolution. The acquisitions are done in two sessions: sunny and after raining condition. The software interface is developed using visual C++. The interface includes captured image and its corresponding weed detected image.
The proposed weed detection algorithm aims to separate weeds from the image background, which are mainly soil components. Since weeds in sugarcane fields are green and have irregular shape, separating weeds from background can be achieved using a colorbased segmentation approach. This approach is fast. This makes it suitable for real-time VRH application.

Offset Excessive Green (OEG):
The OEG is a simple color-based segmentation approach for segmenting green weeds from the background. The approach calculates offset excessive green value of each pixel from its RGB value using following equation: where, R, G and B are pixel intensity in its red, green and blue channel, respectively. To detect weeds, the OEG of every pixel is computed. Then, an appropriate threshold value is applied to segregate weeds from the background. Several threshold values are experimented in our research. A threshold value of 20 gives the best segmentation output. Figure 1 present segmentation output obtained from the OEG with threshold value of 20. From experimental results, the OEG works nicely in high density weed images such as Fig. 1a and b. However, in the sparse, low density weed image, the OEG has an over-segmentation problem. Soil background is segmented as weeds in several areas. This over-segmentation problem leads to excessive usages of herbicide, rising cost of operations and pollution problem. Reducing these falsely classified areas can be done using higher threshold value. However, under-segmentation will occur in high density weed images. Therefore, appropriate threshold value for field application must be search beforehand.

Non-Green Subtraction (NGS):
The Non-Green Subtraction (NGS) is introduced in this study in order to address the over-segmentation problem of the OEG. From our observations, color of most falsely segmented pixels is clustered closer to color of soil component than color of green weeds. Therefore, color segmentation based on chromatic information of soils will include the falsely classified pixels within the segmentation result.
To classify weeds in an input image, background of the image is firstly segmented using the NGS. Then, the non-background pixels are re-classified as weeds or backgrounds using the OEG. This is to prevent wrongly classifying non-green objects as weeds. Hierarchically filtering image this way improves segmentation accuracy. This equation is derived based on histogram of input images, in which deviations of the three triplets (red, green and blue) from its average value of weeds and background are significantly discriminating.
To compensate effects of illumination changes, highlights and shadows, an adaptive thresholding is used for the NGS segmentation. The threshold valued is adjusted based on difference value between chromatic intensity and its average value. The threshold is denoted as follows: NGSth = 9*|M-G|-0.8*|M-B|-0.8*|M-R| (3) Figure 2 shows example results of our proposed weed detection method. It is clearly seen that the misclassified regions in Fig. 2d are removed.

RESULTS
We evaluated our proposed method by comparing the obtained image with its corresponding ground-truth image. The ground-truth images are manually segmented.   The system accuracy is measured in terms of False Accept Rate (FAR), False Reject (FRR) rate and correct segmentation rate. False Accept Rate (FAR) is a ratio of falsely accepted backgrounds as weeds and a total number of classified pixels. False Reject Rate (FRR) is a ratio of falsely rejected weeds as background and a total number of classified pixels. Correct segmentation rate is a ratio of falsely classified pixels and a total number of classified pixels. Since, the OEG requires a threshold value for segmenting weeds. Our first experiment is to search for the optimum threshold value. Table 1 indicates system performance of the OEG and our purposed method. Figure 3 shows its error distribution graph.

DISCUSSION
From our experiments, threshold value of 29 yields the best overall correct segmentation rate. The chosen threshold value affect the obtained FAR and FRR. The two values run in opposite direction; increasing FRR decreasing FAR and vice versa. From the obtained graph, it is clearly seen that our purposed system is less sensitive to changes of the chosen threshold value.  System performance of the OEG and the proposed method are equivalent for high distributed weed images. However, in the low distributed weed images, the proposed method is outperformed the OEG in terms of FAR and correct segmentation rate. Especially, the FAR is reduced from 2.692-0.894%, as shown in Table 2. Additionally, our proposed method has less over-segmentation problem with the after raining images comparing to the result obtained using the OEC. Therefore, the proposed method is more effective in handling large range of soil intensity.
Our major errors occur nearby boundary pixels of weeds. These boundary pixels are hardly classified even when doing it manually as shown in Fig. 4. Human eyes can distinguish weeds from the background better since both color and shape information is used. The shape analysis is excluded from our proposed method due to limitations of computational resources of embedded device and real-time processing requirement.

CONCLUSION
In this study, a new color-based weeds detection using machine vision is developed. The detection scheme is designed to compensate effects of illumination variations. The proposed method is fast and suitable to use in limited resources device such as in embedded system. The proposed method is also feasible for future real-time application.
Background component of an input image is segmented using the proposed Non-Green Subtraction (NGS) technique. The NGS segregate an image into two classes, which are background and nonbackground. The non-background is further segmented into weed and non-weed pixels using over excessive Green (OEG) technique. The experimental results indicate significant improvement on the false accepted rate and overall correct segmentation rate, especially with sparse weed images comparing to the results obtained using only the OEG technique. Our future researches are generating herbicide maps for precision spraying and real-time field tests. Different resolutions of herbicide map will be investigated using variable rate herbicide applicators. An optimal quantity herbicide usage will be studied. Figure 4 shows an example of possible resolutions used in our future researches. An image will be divided into several blocks (resolutions). For each block, density of weeds is computed based on an amount of detected weeds. Different densities are indicated with different gray values as shown in Fig. 5.