DEVELOPMENT OF AN IMAGE RECOGNITION SYSTEM FOR CROP DISEASE IDENTIFICATION OF PADDY FIELDS IN SRI LANKA A dissertation submitted to the Department of Electrical Engineering, University of Moratuwa in partial fulfillment of the requirements for the Degree of Master of Science by GEHAN ANTHONYS Supervised by: Dr. Nalin Wickramarachchi Department of Electrical Engineering, University of Moratuwa 2009 92424 Abstract The classification and recognition of paddy diseases are of the major technical and economical importance in the agricultural industry. To automate these activities, like texture, color and shape, disease recognition system is feasible. The goal of this research is to develop an image recognition system that can recognize paddy diseases. Images were acquired under laboratory condition using digital camera. Four major diseases commonly found in Sri Lanka, Rice blast (Magnaporthe grisea), Rice sheath blight (Rhizoctonia solani), Brown spot (Cochiobolus miyabeanus) and False smut (Ustilaginoidia virens) were selected for this study. Image processing starts with the digitized a color image of paddy disease leaf. Then a method of mathematics morphology was introduced to segment these images. Then texture, shape and color features of color image of disease spot on leaf were extracted, and a classification method of membership function was used to discriminate between the four types of diseases. The analysis of the results shows over 70 percent classification accuracy over 50 .sample images. The conclusion is that in case of reasonably good images, this approach yields excellent results, Use of powerful RGB camera would allow higher precision of the image color and segmentation. D e c l a r a t i o n ~ T h e w o r k s u b m i t t e d i n t h i s d i s s e r t a t i o n i s t h e r e s u l t o f m y o w n i n v e s t i g a t i o n , e x c e p t w h e r e o t h e r w i s e s t a t e d . I t h a s n o t a l r e a d y b e e n a c c e p t e d f o r a n y d e g r e e , a n d i s a l s o n o t b e i n g c o n c u r r e n t l y s u b m i t t e d f o r a n y o t h e r d e g r e e . ~v'\ G e h a n A n t h o n y s I e n d o r s e t h e d e c l a r a t i o n b y t h e c a n d i d a t e . j/LA~ '~ D r . N a l i n W i c k r a m a r a c h c h i D e c l a r a t i o n A b s t r a c t A c k n o w l e d g e m e n t L i s t o f F i g u r e s L i s t o f T a b l e s 1 . I n t r o d u c t i o n I . 1 B a c k g r o u n d 1 . 2 P r o b l e m S t a t e m e n t 1 . 3 A i m a n d O b j e c t i v e s C o n t e n t s 1 . 4 O r g a n i z a t i o n o f t h i s T h e s i s 2 . P a d d y D i s e a s e s 2 . 1 I n t r o d u c t i o n ; 2 . 1 . 1 P r o b l e m s o f p a d d y ( r i c e ) d i s e a s e s 2 . 1 . 2 R e c o g n i t i o n o f r i c e d i s e a s e s 2 . 2 C h a r a c t e r i s t i c 2 . 2 . 1 C o m m o n r i c e d i s e a s e s 2 . 2 . 2 R i c e B l a s t ( M a g n a p o r t h e g r i s e a ) 2 . 2 . 3 S h e a t h B l i g h t ( R h i s o c t o n i s o l a n i ) 2 . 2 . 4 B r o w n S p o t ( C o c h l i o h o l u s m i y a b c a n u s 2 . 2 . 5 F a l s e S m u t ( U s t i l a g i n o i d e a v i r e n s ) 2 . 3 L i t e r a t u r e r e v i e w o n D i s e a s e r e c o g n i t i o n 2 . 3 . 1 L e a v e s r e c o g n i t i o n u s i n g B a c k p r o p a g a t i o n N e u r a l N e t w o r k 2 . 3 . 2 A n l n t e t , r r a t e d I m a g e p r o c e s s i n g s y s t e m f o r L e a f d i s e a s e d e t e c t i o n a n d d i a g n o s i s 3 . I m a g e R e c o g n i t i o n 3 . 1 I n t r o d u c t i o n 3 . 2 A p p r o a c h e s 3 . 2 . 1 G r e y - L e v e l S e g m e n t a t i o n o r T h r e s h o l d M e t h o d 3 . 2 . 2 E d g e - D e t e c t i o n T e c h n i q u e s 3 . 2 . 3 D i g i t a l M o r p h o l o g y 3 . 2 . 4 T e x t u r e 3 . 2 . 5 T h i n n i n g a n d S k e l e t o n i z a t i o n A l g o r i t h m s 4 . I d e n t i f i c a t i o n D i s e a s e s o f I m a g e A n a l y s i s 4 . 1 O v e r v i e w 4 . 2 I m a g e D i g i t i z a t i o n 4 . 3 S e g m e n t a t i o n o f p l a n t d i s e a s e s p o t o n l e a f 4 . 4 E x t r a c t i o n o f p a d d y d i s e a s e f e a t u r e s 4 . 4 . 1 E x t r a c t i o n o f c o l o r t e x t u r e 4 . 4 . 2 E x t r a c t i o n o f c o l o r f e a t u r e o n d i s e a s e s p o t 4 . 4 . 3 E x t r a c t i o n o f s h a p e f e a t u r e o n d i s e a s e s p o t 1 1 1 \ \ \ I \ I I 1 2 2 3 . . . , . 1 . . . , _ ) 4 5 5 6 7 7 ~ 9 9 1 1 1 2 1 3 1 4 1 5 1 6 1 6 1 7 1 8 1 9 2 0 2 2 4 5 C l a s s i f i c a t i o n 4 . C J R e c o g n i t i o n 5 . I m p l e m e n t a t i o n 5 . 1 S y s t e m ( ' o n 1 i g u r a t J O n 5 . 1 . 1 H a r d w a r e a m i S o f t w a r e 5 . 1 . 2 S o f t w a r e F i l e s 5 . 2 S c r e e n S h o t s n . . 2 4 2 5 2 5 2 5 5 . 2 . 1 L o g i n A u t h e n t i c a t i o n 2 7 5 . 2 . 2 l R S p a d d y s y s t e m " 2 7 5 . 2 . 3 I m a g e r e c o g n i t i o n s t e p s i n t h e s y s t e m ( i n U s e r m o d e ) 2 9 5 . 2 . 4 I m a g e r e c o g n i t i o n i n A u t o m o d e 3 2 5 . 3 R e s u l t s 3 5 6 . C o n c l u s i o n 6 . 1 P e r f o r m a n c e 6 . 2 D i s c u s s i o n 6 . 3 F u t u r e W o r k B i b l i o g r a p h y A p p e n d i x A : R i c e D i s e a s e s A p p e n d i x B : I n t r o d u c t i o n t o C o l o r S p a c e - C I E L a b A p p e n d i x C : S o u r c e C o d e s I l l 3 6 3 6 3 6 3 7 3 8 3 9 4 1 4 4 A c k n o w l e d g e m e n t s ; T h a n k s a r c d u e f i r s t t o m y s u p e r v i s o r . D r . N a l i n W i c k r a m a r a c h c h i . f o r h i s g r e a t i n s i g h t s , p e r s p e c t i v e s a n d g u i d a n c e f o r m a k i n g t h i s p r o j e c t a n d s u c c e s s . I a m g r a t e f u l t o D r . N i m a l D i s a n a y a k a , D i r e c t o r o f R i c e R e s e a r c h a n d D e v e l o p m e n t I n s t i t u t e a t B a t a l a g o d a , l h b a g a m u w a f o r s u p p o r t i n g m e t o g a i n i n f o r m a t i o n a b o u t p a d d y p l a n t s i n S r i L a n k a . v L i s t o f F i g u r e s F i g u r e 2 . 1 I n f e c t e d o f R i c e B b s t c h s c < J s c 2 . 2 I n f e c t e d o f S h e a t h B l i g h t d i s e a s e 2 . 3 I n f e c t e d o f B r o w n S p o t d i s e a s e 2 . 4 I n f e c t e d o f F a l s e S m u t d i s e a s e ; P a g e 5 5 6 7 3 . 1 C o m p o n e n t s o f a n I m a g e r e c o g n i t i o n s y s t e m 1 0 3 . 2 L d g e M o d e l s 1 3 3 . 3 T h e r e s u l t o f a p p l y i n g m u l t i p l e o p e n i n g t o a n i m a g e 1 4 3 . 4 C o m p a r i s o n t h e S k e l e t o n i z a t i o n P r o c e s s b y T w o A l g o r i t h m s 1 5 4 . 1 A n o v e r v i e w o f d i s e a s e i d e n t i f i c a t i o n p r o c e s s I 7 4 . 2 O r i g i n a l s w i t h D i g i t i z e i m a g e s 1 8 4 . 3 S e g m e n t e d i m a g e s 1 9 4 . 4 E x t r a c t i o n o f c o l o r t e x t u r e 2 0 4 . 5 T w o e x t r a c t i o n c h a r t s o f c o l o r f e a t u r e i n a * h * s p a c e w i t h o r i g i n a l s 2 1 5 . 1 L o g i n a u t h e n t i c a t i o n f o r t h e I R S s y s t e m 2 7 5 . 2 I R S p a d d y s y s t e m w i t h t h e c o r r e s p o n d i n g l o g o n 2 7 5 . 3 A b o u t t h e I R S s y s t e m 2 S 5 . 4 R e s o u r c e s f o r t h e I R S s y s t e m 2 8 5 . 5 I m a g e s b a n k 2 9 5 . 6 R G B v a l u e s o f t h e i m a g e 2 9 5 . 7 I m a g e a f t e r t h e d i g i t i z a t i o n 3 0 5 . 8 G r a y s c a l e i m a g e w i t h i m < J g e a f t e r t h e s e g m e n t a t i o n 3 0 5 . 9 I m a g e a f t e r t h e e x t r a c t i o n o f c o l o r t e x t u r e 3 1 5 . I 0 I m a g e a f t e r t h e e x t r a c t i o n o f c o l o r f e a t u r e 3 1 5 . 1 1 I m a g e a f t e r t h e e x t r a c t i o n o f s h a p e f e a t u r e 3 2 5 . 1 2 R e c o g n i z i n g t h e d i s e a s e ( i n U s e r m o d e ) 3 2 5 . 1 3 O r i g i n a l i m a g e 3 3 5 . 1 4 I m a g e s a f t e r t h e I m a g e p r o c e s s i n g s t e p s 3 3 5 . I 5 I m a g e a f t e r t h e e x t r a c t i o n o f t h e s h a p e 3 4 5 . 1 6 R e c o g n i z i n g t h e d i s e a s e ( i n A u t o m o d e ) 3 4 5 . 1 7 ( a ) P r o p e r t i e s o f t h e s e l e c t e d i m a g e 3 5 5 . 1 7 ( b ) P r o p e r t i e s o f a l l i m a g e s 3 5 V I . . L i s t o f T a b l e s T a b l e 2 . 1 R i c e d i s e a s e s 1 1 1 S r i L a n k a 4 . 1 M e m b e r s h i p ! ' u n c t i o n s f o r e a c h t y p e o f d i s e a s e ; 4 . 2 S i g n s a n d S y m p t o m s f o r e a c h t y p e o f d i s e a s e 5 . 1 h i e c o n f ] g u r a t i o n o f t h c s y s t e m 6 . 1 P e r f o r m a n c e o f t h e s y s t e m V l l P a g e 4 / ' 1 2 4 2 5 3 6