Weed Detection in Farm Crops Using Parallel Image Processing

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

2018 Conference on Information and Communication Technology (CICT'18)

Weed Detection in Farm Crops using Parallel


Image Processing
Umamaheswari S Arjun R Meganathan D
Dept of Information Technology Dept of Information Technology Dept of Electronics Engineering
MIT Campus Anna University MIT Campus Anna University MIT Campus Anna University
Chennai, India Chennai, India Chennai, India
[email protected] [email protected] [email protected]

Abstract— Human community are educated about the metrics for evaluation and comparison of different
environmental issues of pesticides and fertilizers used in algorithms in the crop/weed discrimination tasks.
agriculture. There is a ever-growing demand for food to be met
by agriculture producers. To reduce the environmental issues The rest of the paper is organized as follows. The related
and address food security, IoT based precision agriculture has existing work is surveyed and presented in section II. The
evolved. Precision agriculture not only reduces cost and waste, architecture and description of the proposed system is
but also improves productivity and quality. We propose a detailed in section III. The experimental results are presented
system to detect and locate the weed plants among the in section IV and compared. Section V discusses the results
cultivated farm crops based on the captured images of the of the proposed system. Section VI concludes the proposed
farm. We also propose to enhance the performance of the work and mentions the future direction.
above system using parallel processing in GPU such that it can
be used in real-time. The proposed system takes real time
II. RELATED WORK
image of farm as input for classification and detects the type
and the location of weed in the image. The proposed work Image processing and computer vision tasks have been
trains the system with images of crops and weeds under deep used for plant classification and crop/weed discrimination at
learning framework which includes feature extraction and various levels.
classification. The results can be used by automated weed
detection system under tasks in precision agriculture. When considering only the plant classification system B.
Yanikoglu and E. Aptoula [4] proposed a plant identification
Keywords— parallelized weed detection, Graphic Processing system for automatically identifying plants in a given image.
Unit, Convolutional Neural Network C. M. Zhai and J. X. Du [5] developed a machine learning
algorithm known as the Extreme Learning Machine (ELM)
I. INTRODUCTION to classify plants by extracting Gabor texture feature of plant/
leaf. These approaches shared with other work [13,15,10]
With existing issues of shortage of manpower and have a limitation that the input is a plane leaf captured in a
resources for agriculture, development of new crop diseases uniform background. Further these approaches only
and weeds, there is advancement in the field of robotic concentrate on classification of plants on different methods
farming and precision agriculture. The problem of efficient and have disadvantage of not being applicable in real-time
weed classification and detection is closely related to the due to problem of segmenting individual leaves from foliage
problems of sustainable agriculture and climate change. images in fields.
Research results indicate that climate change can introduce
new and hybrid weeds to existent species. Hence, it is A. Ozdemir and T. Altiler [1] proposed a weed detection
important to develop new technologies that help to identify system using ground based hyperspectral images of corn
weeds present along with farm crops as they can affect their crop fields The system involved preprocessing and
growth. The detection of weeds is also useful for removal of normalisation steps followed by classification using
weeds, thus reducing the usage of pesticides and providing SVM/LDA. D. Seatovic, H. Kutterer and T. Anken [6]
efficient alternatives at the time of harvesting the crops. proposed a system using 3D images of the plants and surface
patches to identify broad leafs from grasses. A. H. Kargar B,
The aim of this paper is to present an end to end system A. M. Shirzadifar [3] developed a new weed detection and
which works in real time by taking images of farm crops as classification method using wavelet transform and
input and produces a set of bounding boxes for each type of morphological operations. J. Pan, M. Huang, and Y.
weed located in the image as output directly. This is He [9] used morphological operations and ANN to
challenging one as it needs to distinguish weeds from the discriminate a crop between two weeds similar in shape and
farm crops and also to estimate the number of different colour. S. Haug, J. Ostermann, and R. Bosch [17] proposed a
weeds and their locations appropriately. This paper proposes machine vision approach without segmenting the individual
a deep learning approach that learns from labelled field leaves. Random Forest classifier is used to classify the
images and detects the weeds present in test images. features extracted from the sparse pixel positions in image.
Although the existing methods consider prediction or These approaches with other works [11,12] share common
classification as an independent problem and need some pre- limitations like involving intense computations for either pre-
processing in the input and post-processing on the detected processing or post-processing of images, complexity in
output, the proposed method does not demand them. The image acquisition process, need for manual annotation and
technical contribution of this paper involves defining the restriction to limited number of weeds.

978-1-5386-8215-9/18/$31.00 ©2018 IEEE

Authorized licensed use limited to: ULAKBIM UASL - KOCAELI UNIVERSITESI. Downloaded on January 16,2023 at 18:01:18 UTC from IEEE Xplore. Restrictions apply.
H. Yalcin and S. Razavi [7] proposed a plant than one rectangle can be stored for each image which
classification system using Convolutional neural networks. indicates the regions have the desired object and the machine
P. Sermanet et al [14] presented an integrated framework for learns the features from them. Similarly, the output image
using Convolutional neural networks for classification, consists of the predicted bounding boxes which locate the
localization and detection. They also proposed a feature weeds present in the image. A sample output image in which
extractor called Overfeat. R. Stewart and M. Andriluka [16] weed detected among carrot crops is given in Figure 2.
developed an end to end approach to detect people in
crowded scenes with modified algorithm called GoogleNet-
Overfeat. These approaches with other works [2] proved the
success of using Convolutional neural networks in image
processing applications like classification and object
detection. Further, A. Ozdemir and T. Altiler [1] compared
various GPU based parallel image processing techniques for
analyzing plant growth. In Kyu Park et al [8] evaluated
various image processing algorithms on GPU using CUDA.
The proposed approach uses the Convolutional Neural
Networks and GPU to solve the existing problems in weed
detection and develop a system to work in real time.

III. PARALLELISED WEED DETECTION SYSTEM


The Parallelised Weed Detection System (PWDS) is
implemented using Convolutional Neural Networks to
Fig. 2. Weed detection among carrot crop in the natural dataset
develop a robust, scalable and real time weed detection
system. The architecture of the proposed Parallelised Weed
Detection System is shown in Figure 1. The feature extraction module which consists of several
modules and layers of Convolutional Neural Network is
implemented by using Googlenet-Overfeat model in
TensorFlow framework. The details of network architecture
are given in [16].

IV. EXPERIMENTAL RESULTS

A. Evaluation Metrics
The proposed system is trained using the standard dataset
provided by [17]. It is also used for comparison of the
performance with the proposed Parallelised Weed Detection
System (PWDS). We defined the metrics for evaluation as
True Positive(TP) : Weed detected by the system
False Positive(FP) : Crop detected by the system
True Negative(TN): Crop not detected by the system
False Negative(FN): Weed not detected by the system
Precision and recall are measures of relevance. Precision
is defined as the fraction of relevant instances among the
retrieved instances and computed using (1).

Precision = (TP)/(TP+FP) (1)


Fig. 1. Architecture of Parallelised Weed Detection System
Recall is defined as the fraction of relevant instances that
have been retrieved over the total amount of relevant
The image acquisition module in Figure 1 consists of instances and is calculated using (2)
collecting the real time images from the carrot farm without
any need for specialized infrared cameras or pre-processing Recall = (TP)/(TP+FN) (2)
of the images. The image labelling module involves the
supervised classification of the images by grouping them into Accuracy is a statistical measure and it used to measure
separate directories. The dataset is the labelled directories how correctly a classification test detects a condition. It is the
containing annotated images. The annotation involves proportion of correctly classified results among the total
identifying the regions were the weeds are present in each number of cases examined. Accuracy is computed using(3)
image provided in the training set. A bounding box is
constructed and the coordinates are saved in JSON file. More Accuracy = (TP+TN)/(TP+TN+FP+FN) (3)

Authorized licensed use limited to: ULAKBIM UASL - KOCAELI UNIVERSITESI. Downloaded on January 16,2023 at 18:01:18 UTC from IEEE Xplore. Restrictions apply.
B. Performance Evaluation The comparison of training time by the parallelised
The proposed weed detection system is parallelised and system implemented using GPU is shown in Table II.
implemented in TensorFlow framework. The experimental
results during the training and evaluation of the standard
TABLE II. COMPARISON OF THE TRAINING TIME OF THE PROPOSED
dataset in [17] under the proposed PWDS are shown in PARALLELISED WEED DETECTION SYSTEM (PWDS) WITH GPU
Table I.
Number Time taken Time taken Speed up
TABLE I. RESULTS DURING TRAINING OF THE PROPOSED of Iterations in CPU(min) in GPU(min)
PARALLELISED WEED DETECTION SYSTEM (PWDS)

No. of True True False False Recall Precision 10,000 655 340 1.92x
Iterations Positive Negative Positive Negative % %

5000 88 33 19 22 80.0 82.2 20,000 1279 659 1.94x

10000 91 36 14 21 81.2 86.6 30,000 1895 976 1.94x

22000 90 46 10 16 84.9 90.0 From the Figure 3, it can be inferred that the proposed
system achieves better recall and precision than the existing
30000 92 47 9 14 86.8 91.1 system in [17]. Further it was found that the system was able
to detect weeds which were not even annotated in [17]. This
is due to difference in the methods used for detection. The
The precision and recall values of the proposed PWDS plant classification system for crop/weed detection in [17]
system are compared with the results of Plant Classification uses features both plants' specific information such as length
system for Crop/Weed discrimination in [17] and it is shown of counter, area, compactness and pixel information such as
in Figure 3. intensities and their distribution. The plant specific features
may vary for every crop in real time which reduces the
accuracy. Whereas, the proposed real time weed detection
system uses only pixels of input image as neurons and uses
the neural network for training and detection of the weeds.
The proposed system is not affected by the changes in the
size or orientation of weed/crop and it is also not affected by
the type of classifier used as in the previous method.

Table I shows that increasing the number of iterations


increases the performance of the system. It is notable that the
false positives and false negatives are decreased with
increase in iterations which is very crucial in implementing
the system in real time. Reducing the number of false
positives is very important as the system should not detect
the crop as weed as it affects the usability of the system.
Fig. 3. Comparison of precision and recall
Further it is evident that the precision and recall values
increase as the number of iteration increase since it is
Also the accuracy of weed detection by the proposed inversely proportional to the false positive and false negative
PWDS is computed using (3) and is compared with the values respectively. Thus the number of iteration plays an
existing method [17] in Figure 4. Though the accuracy of important factor in determining the performance of the
the proposed system is in par with existing system, it system and it is directly proportional to the precision and
outperforms the existing system in precision and recall. recall metrics. As the number of iterations increases, the
execution time also increases. Hence the parallelised weed
detection system is implemented using GPU.
From Table II, it can be observed that there is a notable
time difference between the proposed real-time weed
detection system under CPU and GPU for the same dataset.
It is evident that the time taken for training the system under
normal Intel i5 core CPU is almost twice the time taken by
the same system supported with GPU. The difference is due
to the parallelisation using the CuDNN libraries in Nvidia
GeForce GT610 graphics processor.

V. DISCUSSION
A new weed detection system is proposed with an
application in carrot crop fields. The results shown in
Fig. 4. Accuracy of weed detection previous section reveals that the system provides a precision

Authorized licensed use limited to: ULAKBIM UASL - KOCAELI UNIVERSITESI. Downloaded on January 16,2023 at 18:01:18 UTC from IEEE Xplore. Restrictions apply.
of 91.1% for carrot field images in which weeds are close to [4] A. H. Kargar B, A. M. Shirzadifar, "Automatic Weed Detection
crops, both are in same size and overlap each other. System and Smart Herbicide Sprayer Robot for corn fields", Proc.
2013 RSI/ISM Int. Conf. on Robotics and Mechatronics, 2013, pp.
Most of the existing works does not address this 468-473.
condition. They fail in recognizing the crop/weed when both [5] B. Yanikoglu and E. Aptoula, C. Tirkaz , “Automatic plant
overlap. When those approaches try to classify only large identification from photographs” Journal of Machine Vision and
Applications,vol. 25, no.6, pp.1369–1383, 2014.
non-overlapping weed segments, it results in large loss of
[6] C. M. Zhai and J. X. Du, "Applying Extreme Learning Machine to
accuracy. The per cell-based results are given which are not Plant Species Identification", Proceedings of the IEEE International
suitable in real-time mechanical treatment for weed removal. Conference on Information and Automation June 20 -23, 2008.D.
Seatovic, H. Kutterer and T. Anken, "Automatic Weed Detection and
The proposed system addresses these issues. It does not Treatment in Grasslands", Proceedings of IEEE ELMAR, 2010, pp65-
need to segment plant/leaf before classification. It outputs the 68.
image with bounding boxes over the weed. This advantage is [7] H. Yalcin and S. Razavi , “Plant Classification using Convolutional
possible because the system automatically extracts features Neural Networks”, IEEE Fifth International Conference on Agro-
from the image without any need of human assistance. Geoinformatics, 2016.
Further the system is robust and scalable as such it can learn [8] In Kyu Park, N. Singhal, Man Hee Lee, Sungdae Cho, and C. W.
to detect any new type of weed. The evaluation proves that a Kim, “Design and Performance Evaluation of ImageProcessing
Algorithms on GPUs”, IEEE Transactions of Parallel and Distributed
real time weed detection system for commercial farm crops Systems, vol. 22, no. l, pp. 91-104, Jan. 2011.
is possible with the proposed method and high precision is [9] J. Pan, M. Huang, and Y. He, "Crop and Weed Image Recognition by
achieved. Morphological Operations and ANN model", Proceedings of IEEE
Instrumentation and Measurement Technology Conference - IMTC
The output of the proposed system can help a robot to pp.1-4, 2007.
plug out the weed selectively. In addition to that, the output [10] L. Gao and X. Lin, "A Study on the Automatic Recognition System of
helps in finding the coverage of weed, the stage of weed Medicinal Plants", Proceedings of 2nd International Conference on
plant (early stage or grown up stage) and crop/weed ratio Consumer Electronics, Communications and Networks, pp.101-103,
which may be helpful for the farmers in decision making the 2012.
techniques to be used or for the devices used in IoT based [11] Md Mursalin, Md. Mesbah-Ul-Awal, “Towards Classification of
precision agriculture. The limitation in the proposed system Weeds through Digital Image”, Fourth International Conference on
Advanced Computing & Communication Technologies, pp.1-4, 2014.
is that the predicted bounding boxes can partly overlap with
[12] M. M. Mustafa, A. Hussain, K. H. Ghazali, and S. Riyadi,
crops due to very close proximity. However this could not be “Implementation of Image Processing Technique in Real Time Vision
a disadvantage in weed control in precision agriculture. Here System for Automatic Weeding Strategy”, IEEE International
the detection of weeds is most important. Symposium on Signal Processing and Information Technology,
pp 1-4, 2007.
[13] N.Valliammal and S.N.Geethalakshmi,"Hybrid Image Segmentation
VI. CONCLUSION Algorithm for Leaf Recognition and Characterization", IEEE
A weed detection system that works in real time without International Conference on Process Automation Control and
need for segmenting plants or leaves is proposed. Feature Computing, pp. 1-6, 2011
extraction and detection are instead done using [14] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus, and
Convolutional Neural Networks without any human Y. LeCun “OverFeat:Integrated Recognition, Localization and
assistance. The proposed method can be used in real fields in Detection using Convolutional Networks” International Conference
on Learning Representations (ICLR2014), CBLS, April 2014, pp 1-
which weeds crowded with crop plants. The output image of 12
the weed detection system can be used for selective weed
[15] R. Hu, W. Jia, H. Ling, and D. Huang, "Multiscale Distance Matrix
treatment. for Fast Plant Leaf Recognition", IEEE Transactions On Image
Processing, vol. 21, no. 11, pp. 4667 - 4672, 2012.
To evaluate the system, a standard dataset of images [16] R. Stewart and M. Andriluka, “End-to-end people detection in
provided in [17] and images captured in carrot crop field at crowded scenes”, IEEE Conference on Computer Vision and Pattern
different conditions are used. The performance is analysed Recognition (CVPR), pp 1-9, 2016.
by training the proposed system with manually annotated [17] S. Haug, J. Ostermann, and R. Bosch, “A Crop /Weed Field Image
input images and comparing the output images with expert Dataset for the Evaluation of Computer Vision Based Precision
labelled ground truth images. The analysis result indicates Agriculture Tasks” Journal on Machine Vision and Applications , vol.
that the proposed system achieves a precision of 91.1%. 8928, pp. 105–116, 2014.

In future, the system will be trained with large datasets


of input images to detect different types of weed such that it
can be used in real-time.

REFERENCES
[1] A. Ozdemir and T. Altiler, “GPU Based Parallel Image Processing for
Plant Growth Analysis”, IEEE Third International Conference on
Agro-geoinformatics, 2014.
[2] A. Ozdemir and T. Altiler, “GPU Based Parallel Image Processing for
Plant Growth Analysis”, IEEE Third International Conference on
Agro-geoinformatics, 2014.
[3] A. Krizhevsky, I Sutskever, and G.E. Hinton , “ImageNet
Classification with Deep Convolutional Neural Networks”,
Proceedings of the 25th International Conference on Neural
Information Processing Systems, pp.1097-1105

Authorized licensed use limited to: ULAKBIM UASL - KOCAELI UNIVERSITESI. Downloaded on January 16,2023 at 18:01:18 UTC from IEEE Xplore. Restrictions apply.

You might also like