PerLeaf Image Classification Application for Plants Leaf and its diseases Presented by: Tamer Aghbar Supervised by: Dr. Mohammad Sharaf Dr. Anas Toma Outline: 1. Introduction 1. Problem Statement 2. Plants Diseases 3. Image Acquisition 2. Image processing 1. Image cropping & resizing 2. Leaf Segmentation 3. Feature Extraction 1. Color Features 2. Texture Features 3. Shape Features 4. Model Training & Accuracies 4. Design & implementation 1. Mobile App 2. Server 5. Conclusion & Future work 6. Demo 7. Final speech 8. Discussion Introduction: - The science of cultivating plants, animals, and other life forms for food. - The most important industry around the world. - The base of the food pyramid - The major industry in the United States. Agriculture Industry 1 Introduction: Green Revolution - Better Quality - More Quantity - Better Income - Better Life 2 Problem Statement: 3 [1] Purification and Phytotoxic Analysis of Botrytis cinerea Virulence Factors: New Avenues for Crop Protection Plants Diseases: 4 1- Grape Black rot 2- Grape Leaf blight Image Acquisition: 5 Dataset Samples: Apple Blueberry Cherry Grape healthy Grape Black rot Grape leaf blight Pepper Potato tomatoStrawberryRaspberry Soybean6 Image Processing: 7.1 Image Processing: 7.2 Image Processing: 7.3 1- Image Cropping & Resizing 8 2- Leaf Segmentation: ? 9.1 2- Leaf Segmentation: 9.1 2- Leaf Segmentation: 9.2 • Shape Segmentation • Texture Segmentation • Color Segmentation 2- Leaf Segmentation: 9.3 • Color Segmentation: R G B [47, 65, 23] 2- Leaf Segmentation: If new_pixel_value > 0: write(new_pixel_value, seg_img); else write(0, seg_img); 9.4 2- Leaf Segmentation: 9.5 Init_mask IC_mask IC_mask_or ICx_mask ICx_mask_and Final_mask_closing 2- Leaf Segmentation: 9.6 Feature Extraction 10.1 Objects Descriptors How to describe our input? It’s a Leaf Grape Leaf Not Healthy Disease Name: Black rot Feature Extraction 10.2 How to “Numeric” these “Descriptors? Feature Extraction 10.3 Manual grouping Random mess!! Feature Extraction 10.4 Manual grouping More Elegant! Feature Extraction 10.5 Main Descriptors 1- Color Features 2- Texture Features 3- Shape Features Feature Extraction 11.1 1- Color Features: Green range: [(35, 0, 0), (75, 255, 255)] Yellow range: [(25, 0, 0), (40, 255, 255)] [LowerColorBoundary, UpperColorBoundary], Feature Extraction 11.2 1- Color Features: Feature Extraction 11.3 1- Color Features: [ green_percentage, yellow_percentage, nonGreen_percentage, Mean, variance, standardDeviation, skewness] = 7 color features Final Output: Feature Extraction 12.1 2- Texture Features: Feature Extraction 12.2 2- Texture Features: GLCM (Gray Level Co-occurrence Matrix) Feature Extraction 12.3 2- Texture Features: GLCM -> [0:12] Features + Correlation & Standard Deviation = [(0:12), correlation, standard_deviation] 15 Texture feature= -> Haralick Texture Algorithm Feature Extraction 13.1 3- Shape Features: Feature Extraction 13.2 3- Shape Features: 3.1 – Eccentricity E = W_max / H_max Feature Extraction 13.3 3- Shape Features: 3.1 – Eccentricity 3.2 – Euler Number • Euler = 1 - #H • avg_areas • avg_areas/leaf_area Feature Extraction 13.4 3- Shape Features: 3.1 – Eccentricity 3.2 – Euler Number 3.3 – Signature Feature Extraction 13.5 3.3 – Signature 3.3.1 – Signature Variance Feature Extraction 13.6 3.3 – Signature 1st Derivative 3.3.2 – 1st Derivative Feature Extraction 13.7 3.3 – Signature 1st Derivative +ve -ve Zeros 3.3.2 – 1st Derivative Feature Extraction 13.8 3.3 – Signature 3.3.2 – 1st Derivative • # of corners = # of zero values (include the margin of threshold) • Corners_percentage = # of corners / # of points • Curvature = (∑nonZerosV alues) / (∑signatureV alues) Feature Extraction 13.9 3- Shape Features: 3.1 – Eccentricity 3.2 – Euler Number 3.3 – Signature AspectRation(Aspect), Compactness(C), Roundness(R), Roughness(G), Elongation(E), Solidity(S) 3.4 – other shape equations: Feature Extraction 13.10 3- Shape Features: [holes_number, holes_meanArea, cntHoles_Area, Eccentricity, Signature_variances_mean, Signature_corners_percent, Signature_Curvature, num_corners, Aspect, C, R, G, E, S] = 14 shape features Final Output: Feature Extraction 13.11 14.1 Model Training: Random Forest Classifier 14.2 Accuracies: • First Accuracy: ~56% (general shape features) • Second Accuracy: ~83% (shape/color) • Third Accuracy: • Master Dataset: ~89.942% (Shape/Color/Texture) • Grape Dataset: ~98.174% (Shape/Color/Texture) 14.3 Model Training & Accuracies It’s a Leaf Grape Leaf Not Healthy Disease: Black rot 15.1 Design & Implementation: Design & Implementation: 15.2 Design & Implementation: 15.3 Design & Implementation: 15.4 Design & Implementation: 16.1 Conclusion & Future work: 1) Dataset 2) Features & Machine Learning 1) Build our own dataset 2) study more disease can be used in our model 1) Make more accurate features 2) Compline similar features by doing some feature analysis, In order to minimize the processing time 16.2 Conclusion & Future work: 3) Mobile Application: 1) Cross platform application 2) Build a website 3) Add dashboard screen 4) Users accounts for non-expert people and experts 5) Involve GPS & maps Demo 17 Presented by: Tamer Aghbar Supervised by: Dr. Mohammad Sharaf Dr. Anas Toma Thank you!