International Journal of Electrical and Computer Engineering (IJECE) Vol. No. June 2016, pp. ISSN: 2088-8708. DOI: 10. 11591/ijece. A Fast and Efficient Shape Descriptor for an Advanced Weed Type Classification Approach Adil Tannouche. Khalid Sbai. Miloud Rahmoune. Amine Zoubir. Rachid Agounoune. Rachid Saadani. Abdelali Rahmani Laboratoire dAoEtude des Matyriaux Avancys et Applications. FS-EST. Moulay Ismail University. BP 11201. Zitoune. Meknes. Morocco Article Info ABSTRACT Article history: In weed management, the distinction between monocots and dicots species is an important issue. Indeed, the yield is much higher with the application of a selective treatment instead of using a broadcast herbicide overall the parcel. This article presents a fast shape descriptor designed to distinguish between these two families of weeds. The efficiency of the descriptor is evaluated by analyzing data with the pattern recognition process known as the discriminant factor analysis (DFA). Excellent results have been obtained in the differentiation between these two weed species. Received Jan 2, 2016 Revised Mar 11, 2016 Accepted Mar 26, 2016 Keyword: Machine Vision Real-time Image Processing Weed Type Classification Precision Agriculture Shape Descriptor Copyright A 2016 Institute of Advanced Engineering and Science. All rights reserved. Corresponding Author: Adil Tannouche. Departement of Electrical and Computer Engineering. LEM2A. High School of Technology. Meknes. Morocco, 212 65 09 60 207. Email: tannouche@gmail. INTRODUCTION The weed control is a key element in smart agriculture. The chemical weed control is widely practiced in order to reduce the infestation rates and to improve harvests. Weeds are divided into two big families: the Monocotyledonous family which is characterized by long and thin leaves. and the Dicotyledonous family with short leaves . ee Figure . In view of this diversity, the weed control performance is even better with the application of a selective treatment instead of using a single broadcast herbicide overall the parcel. In this regard, recent researches in computer vision have given birth to several efficient techniques for detection and / or classification of weeds. Traditionally, two main approaches are C A spectral approach : this approach consists in decoding the spectral information to detect the presence of weed in the parcels. In . , respectively, the authors used the information revealed by the near infrared (NIR) and the simple (RGB) pictures to detect weeds. In . , the authors used the UV fluorescence spectrum. In . , the authors analyzed the hyperspectral images to properly detect and select the weeds. Despite his performance, this technique requires an expensive equipment. C A spatial approach : this technique focuses on the distribution of weeds in the parcel or on their morphological forms . in order to identify them. In . , the authors detected weeds by observing their presence in the seed line spacing. In . , the authors examined the shape of weeds by using the seven moments of Hu . and six shape descriptors to achieve a better selection of weeds. The results are very satisfactory in spite of the processing time of about two frames per second. Journal homepage: http://iaesjournal. com/online/index. php/IJECE IJECE ISSN: 2088-8708 A 1169 In this study, we present a new innovative, fast and efficient approach for the selection of weeds Our approach based essentially by the application of binary descriptor designed for this purpose. This descriptor called Adjacencies Descriptor returns the number of horizontal, vertical and diagonal adjacencies for a given 2D object. This technique allow distinguishing between the shapes with a rounded morphology (Dico. and others with a long thin morphology (Monoco. Figure 1. Weed samples: monocot in first line and dicot in second line MATERIAL AND METHOD The imaging system is composed of a standard RGB camera. The camera held in vertical position at 25 to 30 cm above the region of interest. Thus, the visible scene covers an area of 50 y 50 cm2 . ee Figure . This setup allows us to overcome the perspective view problem and improve the spatial resolution. Figure 2. Acquisition process: camera on a tripod at approximately 0. 3 m height pointing vertically downward The Adjacencies Descriptor Our region-based descriptor calculates the number of horizontal, vertical and diagonal adjacencies between a given original pixel and their adjacent ones . ee Figure . The original pixel . reen cel. , is surrounded by eight other peripheral pixels . ellow and blue cell. Cells in yellow show horizontal and vertical adjacencies and the blue ones show diagonally adjacencies with respect to the original cell. A Fast and Efficient Shape Descriptor for an Advanced Weed Type Classification . (Adil Tannouch. A ISSN: 2088-8708 Figure 3. Descriptor structure The proposed descriptor calculates two numbers of adjacencies between a given original pixel (C. and their adjacent pixels (CA, such as A = 1, 2, 3, 4, 5, 6, 7, . The first is the number of horizontal and vertical adjacencies (NHV), the second is the number of diagonal adjacencies (ND). The adjacency (Ad. is the result of the binary operator XNOR between the original cell and an adjacent cell as followings: Adj (CA) = C0 (XNOR) CA Thereby, in a binary image, the adjacency numbers for a given original pixel C. are calculated according to the following formulas: NHV = Adj(C. -step, . ) Adj(C. step, . ) Adj(C. , y-ste. ) Adj(C. , y ste. ) . ND = Adj(C. -step,y-ste. ) Adj(C. -step,y ste. ) Adj(C. step,y-ste. ) Adj(C. step,y ste. ) . Applying this descriptor on all pixels belonging to one particular object, allow to distinguish between shapes with rounded and filled morphology (Dico. and others shapes with a long and thin morphology (Monoco. The Step variable must then be adapted to the resolution of the object to describe. Indeed, a small value retains only noise, while too large value encompasses the object without defining its characteristics. Good results are obtained using the following empirical formula: Where S is the area . n pixel. of the object to describe. Implementation In digital image segmentation applications, clustering technique is used to segment regions of interest and to detect borders of objects in an image . The gradient magnitude and coherence is used to segment fingerprint image . In our application, the obtained image is segmented in order to isolate the vegetation of the rest of the scene. According to . , this operation is effectively carried out by thresholding the image given by the following formula: Gray = r y R g y G b y B With: r = Oe0. 884, g = 1. 262 and b = Oe0. Where R. G and B represent red, green and blue components of each pixel. Thus, the pixels related to the vegetation are obtained for: Gray > 30 . ee Figure . IJECE Vol. No. June 2016 : 1168 Ae 1175 IJECE A 1171 ISSN: 2088-8708 The application of descriptor is realized on the segmented image by assuming a . pixels sliding window. Then, the results returned by the descriptor are classified according to DFA discrimination function . A majority of votes provided by the sliding window obtains the final classification of a region in the image. Figure 4. Segmentation Vegetation / ground, vegetation and the rest of the scene are represented respectively by white and black pixels RESULTS AND DISCUSSIONS The Local Binary Pattern (LBP) . inspires our descriptor. It allows describing the size and the morphological form of weeds by two integers ND and NHV. To assess and evaluate its performance, we designed a database constituted of 40 images of the most frequent weeds. Then, each image is shifted and rotated randomly to increase the size of our database. Finally, these images are standardized to the working size . * . For DFA method, more than 100 subjects are suggested, but according to . the general rule is to have a ratio of 10 subjects per variable inserted in the analysis. For a total of 86 images, we used half of the images for learning and the other half to the test. The procedure of DFA was performed by means of XLSTAT software. DFA is probably the most frequently used supervised pattern recognition method and the beststudied one . DFA is based on the determination of discriminant functions, which maximize the ratio of between-class variance and minimize the ratio of within-class variance. As in PCA, this technique is a factorial method. In fact, using this method, data are separated in a priori defined classes. The objective sought using DFA is to investigate if the variables ND and NHV are sufficient or not to allow a good a posteriori classification of data in their a priori groups. The following tables (Table 1 and . show respectively the Wilks' Lambda test (Rao approximatio. and the Bartlett's test of sphericity: Table 1. Wilks' Lambda test (Rao approximatio. Lambda F (Valeur observy. F (Valeur critiqu. DDL1 DDL2 p-value 0,448 24,669 3,232 < 0,0001 0,05 Table 2. Sphericity Bartlett's test KhiA (Valeur observy. KhiA (Valeur critiqu. DDL p-value 55,95 3,841 < 0,0001 0,05 Wilks' Lambda test interpretation : A Fast and Efficient Shape Descriptor for an Advanced Weed Type Classification . (Adil Tannouch. A ISSN: 2088-8708 H0: The mean vectors of the two classes are equal. Ha: At least one of the mean vectors is different from another. Since the calculated p-value is less than the significance level of alpha = 0. 05, one must reject the null hypothesis H0, and retain the alternative hypothesis Ha. The risk of rejecting the null hypothesis H0 when it is true is less than 0. Sphericity Bartlett's test interpretation: H0: There is no significantly different correlation of 0 between variables. Ha: At least one of the correlations between the variables is significantly different from 0. Since the calculated p-value is less than the significance level of alpha = 0. 05, one must reject the null hypothesis H0, and retain the alternative hypothesis Ha. The risk of rejecting the null hypothesis H0 when it is true is less than 0. The canonical discriminant functions returned by DFA as: F1 = 0. 013 NHV Ae 0. 01 ND Ae 0. This function is used to classify the weeds into two classes Monocot and Dicot . ee Figure . The classification quality is shown by the ROC curve . ee Figure . (Axes F1 et F2 : 100,00 %) Courbe ROC (AUC=0,. Mono Dicots Sensibility F2 . ,00 % ) F1 . ,00 % ) Barycentres Figure 5. Weed classification according to canonical discriminant functions returned by DFA 1 - Spycificity Figure 6. The ROC curve : sensitivity / specificity report. Applying DFA on database images, a good separation between weeds species was obtained. (Figure . shows how the first DFA function discriminate among clusters. DFA model was cross-validated using leave-one-out approach. An accuracy of 94. 74 % success rate in the recognition of dicots. On the other hand. DFA classifier for the monocots has reached 95. 83 % of the correct classification. Total accuracy is of 35% success rate . ee Table . Table 3. Confusion matrix for the results of cross-validation From \ To Dicot Monocot Total Dicot Monocot Total % correct 0,9474 0,9583 0,9535 In addition, the main advantage of our descriptor resides in its speed (See Table . and ease of Indeed: Step is the only parameter to adjust. Hence, the descriptor presents robustness against the brightness change, rotation and translation. In this table, we can clearly notice that our descriptor has a low computational cost. In practice, in precision agriculture, a scene is never covered with vegetation to 100%. The experiments were conducted on IJECE Vol. No. June 2016 : 1168 Ae 1175 IJECE A 1173 ISSN: 2088-8708 a computer with i5 processor at 2. 2 GHz with 4GOctets DDR4 ram. The execution time is less than 5. 10-3 s by image. Table 4. Number of possible comparisons depending on the size of the sliding window Window Size Height Width Number of comparisons H yLy8 This allows our descriptor to work at real time with a standard value of 25 frames per second. practice, a majority of votes provided by the sliding window obtains the final classification of a region in the The results of our experiment are very promising. We got a correct classification rate of around 85% on a set of 50 images analyzed. Monocotyledonous weeds have been classified correctly up to 90% of cases, while the dicotyledonous weeds have been recognized to about 80%. Figure 7 shows an example of processing performed by our approach, monocotyledonous weeds are marked in blue and dicotyledonous weeds are marked in red. This figure also shows two errors out of 26 classifications. Figure 7. Classification results: Monocotyledonous in blue, dicotyledonous in red and classification errors CONCLUSION We achieved a system for discriminating between monocotyledonous and dicotyledonous weeds This system is based on our adjacencies descriptor designed for this purpose. This is a robust binary descriptor, fast and easy to use. The results obtained were very satisfactory for a fast execution time of the order of 25 frames per second. We plan to improve these results by other adopters of learning and classification methods. In the light of these results, the proposed classification systems represent an excellent, fast and efficient shape descriptor for an advanced weed type classification approach. REFERENCES