Update README.md
Browse files


README.md
CHANGED
@@ -1,17 +1,84 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
sdk: gradio
|
12 |
sdk_version: 4.15.0
|
13 |
app_file: app.py
|
14 |
pinned: false
|
15 |
-
license: mit
|
16 |
Contributor: Jannatul Ferdaws Amrin
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
Introduction: >-
|
3 |
+
The model is a simple Image Classification model trained on the 5 types of
|
4 |
+
Grapevine Leaves dataset. It uses the `gradio` SDK to create a simple UI for
|
5 |
+
the Image Classifier of the Grapevine Leaves model. The model is hosted on
|
6 |
+
the Hugging Face Hub and can be accessed at
|
7 |
+
https://huggingface.co/spaces/jannatulferdaws/amrin_gradio_grapevine. We have
|
8 |
+
taken our dataset from the kaggle dataset
|
9 |
+
https://www.kaggle.com/datasets/muratkokludataset/grapevine-leaves-image-dataset?resource=download.
|
10 |
+
The dataset contains 5 classes of grapevine leaves. The classes are :- Black
|
11 |
+
Rot, Esca (Black Measles), Healthy, Leaf Blight (Isariopsis Leaf Spot), and
|
12 |
+
Leaf Blight (Black Dead Arm). The dataset contains 1000 images of grapevine
|
13 |
+
leaves. The dataset is divided into 80% training set and 20% test set. The
|
14 |
+
model is trained on the training set and tested on the test set. The model is
|
15 |
+
trained for 10 epochs.
|
16 |
+
Model architecture: >-
|
17 |
+
The model is trained on the `MobileNetV2` architecture. MobileNetV2 is a
|
18 |
+
convolutional neural network design aimed at achieving high performance on
|
19 |
+
mobile devices. It adopts an inverted residual structure, featuring residual
|
20 |
+
connections between bottleneck layers. The intermediate expansion layer
|
21 |
+
employs lightweight depthwise convolutions to introduce non-linearity while
|
22 |
+
filtering features. In summary, MobileNetV2 consists of an initial fully
|
23 |
+
convolutional layer with 32 filters, succeeded by 19 residual bottleneck
|
24 |
+
layers.. The model is trained on the `Adam` optimizer with a learning rate of
|
25 |
+
`0.0001`. The model is trained on the `categorical_crossentropy` loss
|
26 |
+
function, `accuracy` metric.
|
27 |
+
How to Guide: >-
|
28 |
+
This is the user interface of the model. We can Select an image from the
|
29 |
+
dropdown menu and click on the `Submit` button or drag and drop an image in
|
30 |
+
the box. The model will classified the image into one of the 5 classes of
|
31 |
+
grapevine leaves. This is the image when the input is given.This is the output
|
32 |
+
of the model. The model has classified the image into the class `Ala_Idris`.
|
33 |
sdk: gradio
|
34 |
sdk_version: 4.15.0
|
35 |
app_file: app.py
|
36 |
pinned: false
|
37 |
+
license: mit
|
38 |
Contributor: Jannatul Ferdaws Amrin
|
39 |
+
language:
|
40 |
+
- en
|
41 |
+
---
|
42 |
+
|
43 |
+
|
44 |
+
# Title:
|
45 |
+
Image Classification of Grapevine Leaves.
|
46 |
+
|
47 |
+
## Introduction:
|
48 |
+
In this project, we are trying to build a model using **PyTorch**, a powerful deep learning framework, for the image classification of five distinct types of grapevine leaves. Our objective is to harness the flexibility and efficiency of PyTorch to develop a robust neural network model. By training on a dataset of grapevine leaf images, our approach seeks to achieve accurate classification, enabling the differentiation of various grapevine varieties. The dataset contains 5 classes of grapevine leaves. The classes are :- Black Rot, Esca (Black Measles), Healthy, Leaf Blight (Isariopsis Leaf Spot), and Leaf Blight (Black Dead Arm). The dataset contains 1000 images of grapevine leaves. The dataset is divided into 80% training set and 20% test set. The model is trained on the training set and tested on the test set. The model is trained for 10 epochs. We have taken our dataset from the kaggle dataset https://www.kaggle.com/datasets/muratkokludataset/grapevine-leaves-image-dataset?resource=download. It uses the *gradio* SDK to create a simple UI for the Image Classifier of the Grapevine Leaves model. This exploration not only demonstrates the potential of PyTorch in image classification but also contributes to the advancement of viticulture through enhanced leaf identification capabilities.
|
49 |
+
### Model Architecture:
|
50 |
+
The model is trained on the `MobileNetV2` architecture. MobileNetV2 is a convolutional neural network design aimed at achieving high performance on mobile devices. The MobileNetV2 model architecture for image classification of grapevine leaves in PyTorch consists of a series of convolutional layers, batch normalization, and rectified linear unit (ReLU) activations. The key components include depthwise separable convolutions, which enhance efficiency. The model utilizes Inverted Residual blocks, containing a combination of 3x3 depthwise separable convolutions and 1x1 pointwise convolutions. The final layers involve global average pooling and a fully connected layer for classification. The output size of the last linear layer should be adjusted based on the specific number of classes in the grapevine leaves dataset.
|
51 |
+
[More Information Needed]
|
52 |
+
|
53 |
+
|
54 |
+
## How to Guide:
|
55 |
+
|
56 |
+
- **Pre-trained Model:**
|
57 |
+
We have trained a model using a deep learning framework 'PyTorch'. Alternatively, you can use a pre-trained model and fine-tune it on your grapevine leaves dataset.
|
58 |
+
|
59 |
+
- **Load the Model:**
|
60 |
+
We have load the pre-trained model using 'torch.load'.
|
61 |
+
|
62 |
+
- **Preprocess Input Image:**
|
63 |
+
We have preprocess the input image to match the format expected by the model. It involved resizing, cropping, and normalizing the image.
|
64 |
+
|
65 |
+
- **Inference:**
|
66 |
+
We have passed the preprocessed image through the model to obtain predictions. The output will be a probability distribution over the different classes.
|
67 |
+
|
68 |
+
- **Post-process Results:**
|
69 |
+
Depending on the model's architecture, the post-process the results obtained the final classification extracting the class with the highest probability or considering top-k predictions.
|
70 |
+
|
71 |
+
- **Display or Use Results:**
|
72 |
+
We have used gradio UI library to display the classification results. We can Select an image from the dropdown menu and click on the `Submit` button or drag and drop an image in the box. The model will classified the image into one of the 5 classes of grapevine leaves.
|
73 |
+
|
74 |
+
Use the code below to get started with the model.
|
75 |
+
https://huggingface.co/spaces/jannatulferdaws/amrin_gradio_grapevine.
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
- **Contributor:** : Jannatul Ferdaws Amrin
|
80 |
+
- **License:** mit
|
81 |
+
- **sdk:** gradio
|
82 |
+
- **sdk_version:** 4.15.0
|
83 |
+
- **app_file:** app.py
|
84 |
+
|