{"id":20937565,"url":"https://github.com/jmcheon/leaffliction","last_synced_at":"2026-04-28T10:36:19.282Z","repository":{"id":257358443,"uuid":"845175184","full_name":"jmcheon/leaffliction","owner":"jmcheon","description":"An innovative computer vision project utilizing leaf image analysis for disease recognition.","archived":false,"fork":false,"pushed_at":"2024-09-18T13:49:15.000Z","size":93656,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T05:04:21.225Z","etag":null,"topics":["image-analysis","image-classification","opencv-python","plantcv","python3","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmcheon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-20T18:18:51.000Z","updated_at":"2024-09-18T13:49:18.000Z","dependencies_parsed_at":"2025-01-19T20:31:44.611Z","dependency_job_id":null,"html_url":"https://github.com/jmcheon/leaffliction","commit_stats":null,"previous_names":["jmcheon/leaffliction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmcheon/leaffliction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcheon%2Fleaffliction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcheon%2Fleaffliction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcheon%2Fleaffliction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcheon%2Fleaffliction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmcheon","download_url":"https://codeload.github.com/jmcheon/leaffliction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmcheon%2Fleaffliction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32377588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T09:24:15.638Z","status":"ssl_error","status_checked_at":"2026-04-28T09:24:15.071Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-analysis","image-classification","opencv-python","plantcv","python3","pytorch"],"created_at":"2024-11-18T22:37:39.657Z","updated_at":"2026-04-28T10:36:19.260Z","avatar_url":"https://github.com/jmcheon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaffliction - Computer vision\n\u003e*_Summary: Image classification by disease recognition on leaves._*\n\n| Requirements | Skills |\n|--------------|--------|\n| - `python3.10`\u003cbr\u003e - `torch`\u003cbr\u003e - `torchvision`\u003cbr\u003e - `opencv`\u003cbr\u003e - `plantcv`\u003cbr\u003e - `numpy`\u003cbr\u003e  - `matplotlib`\u003cbr\u003e  | - `Rigor`\u003cbr\u003e - `Group \u0026 interpersonal`\u003cbr\u003e - `Algorithms \u0026 AI` |\n\n## Usage\nThere are 4 distinct parts in this project, `01. Distribution`, `02. Augmentation`, `03. Transformation`, and `04. Classification`.\n\n### 01. Distribution\nDownload image dataset and generate distribution chart image\n```bash\nusage: 01.Distribution.py [-h] directories [directories ...]\n\nA program to analyze plant images and generate charts.\n\npositional arguments:\n  directories  The directories to store extracted images and save the charts (ex: 01.Distribution apple)\n\noptions:\n  -h, --help   show this help message and exit\n```\n\n#### Example\n```bash\npython3  01.Distribution.py  apple  grape\n```\n\n\u003cbr/\u003e\n\n### 02. Augmentation\nAugment unbalanced image dataset\n```bash\nusage: 02.Augmentation.py [-h] [file_path]\n\nA program to augment images samples by applying 6 types of transformation.\n\npositional arguments:\n  file_path   Image file path to transform to 6 different types.\n\noptions:\n  -h, --help  show this help message and exit\n```\n\n#### Example\n```bash\npython3  02.Augmentation.py\n```\n\n\u003cbr/\u003e\n\n### 03. Transformation\nSave transformed image plots\n\n```bash\nusage: 03.Transformation.py [-h] -src [SRC_PATH] [-dst [DST_PATH]] [-gaussian] [-mask] [-roi] [-analyze] [-pseudo] [-hist]\n\nA program to display image transformation.\n\noptions:\n  -h, --help            show this help message and exit\n  -src [SRC_PATH], --src_path [SRC_PATH]\n                        Image file path.\n  -dst [DST_PATH], --dst_path [DST_PATH]\n                        Destination directory path.\n  -gaussian, --gaussian_blur\n                        Gaussian Transform\n  -mask                 Mask Transform\n  -roi, --roi_objects   Roi Transform\n  -analyze, --analyze_object\n                        Analyze Transform\n  -pseudo, --pseudolandmarks\n                        Psudolandmark Transform\n  -hist, --color_histogram\n                        Color histogram Transform\n```\n\n#### Example\n```bash\npython3  03.Transformation.py  -src [SRC_PATH] -dst [DST_PATH]\n```\n\n\u003cbr/\u003e\n\n### 04. Classification\nPrint the accuracy on validation dataset\n\n```bash\nusage: 04.Classification.py [-h] [folder_path]\n\nA program to classify a type of leaf from validation set.\n\npositional arguments:\n  folder_path  Image folder path.\n\noptions:\n  -h, --help   show this help message and exit\n```\n\n#### Example\n```bash\npython3  04.Classification\n```\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## Implementation\n\n### Leaf Classifier CNN Model\nThe model is designed to classify leaf diseases based on images of leaves. The model is implemented using Pytorch and consists of 4 convolutional layers followed by max pooling, along with 2 fully connected layers. The final output is produced using a softmax function for multi-class classification.\n\n#### Model Architecture\n1. Input layer\n\t- Input: Leaf images with a shape of (256, 256, 3) corresponding to 256 x 256 RGB images.\n\n2. Convolutional layers\n\t- Conv Layer 1\n\t\t- Input channels: 3 (RGB)\n\t\t- Output channels: 32\n\t\t- Kernel size: 3 x 3\n\t\t- Activation function: ReLU\n\t\t- Max Pooling: 2 x 2\n\t- Conv Layer 2\n\t\t- Input channels: 32\n\t\t- Output channels: 64\n\t\t- Kernel size: 3 x 3\n\t\t- Activation function: ReLU\n\t\t- Max Pooling: 2 x 2\n\t- Conv Layer 3\n\t\t- Input channels: 64\n\t\t- Output channels: 128\n\t\t- Kernel size: 3 x 3\n\t\t- Activation function: ReLU\n\t\t- Max Pooling: 2 x 2\n\t- Conv Layer 4\n\t\t- Input channels: 128\n\t\t- Output channels: 256\n\t\t- Kernel size: 3 x 3\n\t\t- Activation function: ReLU\n\t\t- Max Pooling: 2 x 2\n\n3. Fully connected layers\n\t- FC Layer 1\n\t\t- Input: Flattened tensor from the previous convolutional layers (256 * 14 * 14 = 50176 units)\n\t\t- Output: 512 units\n\t\t- Activation function: ReLU\n\t\t- Dropout: 0.5\n\t- FC Layer 2\n\t\t- Input: 512 units\n\t\t- Output: `NUM_CLASSES` units (representing the number of disease classes)\n\t\t- Activation function: Softmax\n\n## Visualization\n\n### 01. Distribution\nThere are 2 distinct leaf types; `apple` and `grape`, each of which consists of 4 labels.\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003e\n\t\t\tApple Image Distribution\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tGrape Image Distribution\n\t\t\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_combined_chart.png\" alt=\"apple image distribution\"\u003e\n\t\t\u003c/td\u003e\n  \t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/grape_combined_chart.png\" alt=\"grape image distribution\"\u003e\t\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n### 02. Augmentation\nThe following 6 image augmentation techniques are applied to one single-leaf image labeled `apple black rot`.\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003e\n\t\t\tBrightness\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tContrast\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tFlip\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tPerspective\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tRotate\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tSaturation\n\t\t\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_Brightness.JPG\" alt=\"augmentation brightness image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_Contrast.JPG\" alt=\"augmentation contrast image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_Flip.JPG\" alt=\"augmentation flip image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_Perspective.JPG\" alt=\"augmentation perspective image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_Rotate.JPG\" alt=\"augmentation rotate image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_Saturation.JPG\" alt=\"augmentation saturation image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n### 03. Transformation\nThe following 6 image transformation techniques are applied to one single-leaf image labeled `apple black rot`.\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003e\n\t\t\tMask\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tGaussian Blur\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tRoi objects\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tAnalyze object\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tPseudolandmarks\n\t\t\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_mask.JPG\" alt=\"transformation mask image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_gaussian_blur.JPG\" alt=\"transformation gaussian blur image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_roi_objects.JPG\" alt=\"transformation roi objects image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_analyze_object.JPG\" alt=\"transformation analyze object image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_pseudolandmarks.JPG\" alt=\"transformation pseudolandmarks image\" width=175px height=175px\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n\u003ctable align=\"center\"\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003e\n\t\t\tColor Histogram\n\t\t\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n  \t\t\u003ctd\u003e\n\t\t\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/apple_black_rot_image (100)_color_histogram.JPG\" alt=\"color histogram image\" width=600px height=400px\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n### 04. Classification\n\n#### Tensorboard\nTo visualize the learning curves using tensorboard, execute the following command.\n```\ntensorboard --logdir runs\n```\n\n#### Validation Accuracy\n\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/validation_accuracy_ex1.png\" alt=\"validation accuracy\"\u003e\n\n#### Test Accuracy\nWe have 10 test images and the model has 100% accuracy \n\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\"https://github.com/jmcheon/leaffliction/blob/main/assets/predicted.png\" alt=\"predicted example1\"\u003e\n\u003c/div\u003e\n\n\n## Resources\n- [Youtube Coursera CNN](https://www.youtube.com/playlist?list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmcheon%2Fleaffliction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmcheon%2Fleaffliction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmcheon%2Fleaffliction/lists"}