Vinny Ramayani Saragih
Mango is one of the plants that are often found in Indonesia. The Central Statistics Agency. recorded manga production in Indonesia as high as 2.84 million tons in 2021. Mangoes can be eaten either ripe or raw. And this fruit can be processed into food or drinks. Many farmers cultivate mango plants, but some diseases can attack mangoes, which can cause yields to fail or the resulting fruit to be in poor condition. Anthracnose and Black Sooty Mold are types of fungal diseases in mango plants, but there are still some farmers who are mistaken about detecting diseases and pests in plants. Therefore, it is necessary to detect the type of disease in mango plants using several images of mango leaves using the Convolutional Neural Network (CNN) method. The test results showed a high accuracy value of 95% in the training data and 98% in the validation data, so it can be concluded that the Convolution Neural Network (CNN) algorithm can detect diseases on mango leaves well.
RESEARCH METHOD
In this research several stages were carried out, as shown in the following figure.
In this study, 1908 leaf images were used, consisting of 3 categories, namely 525 leaf images affected by Anthracnose, 656 leaf images affected by Black Soothy Mold and 224 healthy leaf images. The data is obtained from the Kaggle website.
Preprocessing is done to prepare raw data for processing by the system, then resizing the image to 256x256 pixels, has 3 channels namely Red, Green and Blue (RGB). Furthermore, because the data used is unbalanced, oversampling is done to avoid overfitting the model. Oversampling is done using data augmentation techniques, here the author uses the technique of flipping the position of an image horizontally or vertically (random flip) and rotating the image (random rotation) [7]. Furthermore, rescaling is also carried out on the input in the form of colored coefficients with a value between 0-255 by calculating the input × 1/255 to change the value to between 0 and 1.
This process is also referred to as the training process where to train the CNN model that has been designed to understand and be able to distinguish leaf images that have been given according to their class index. We use CNN coupled with softmax activation in the output layer. We also added initial layers for resizing, normalizing, and augmenting data. The model is trained with 30 steps per epoch of 50 epochs, the data set tested during model training is 80% of all data. For more details can be seen in table 1.
Tabel 1. CNN Network Architecture
Layer (type) | Output Shape | Param # |
sequential ( Sequential ) | (32, 256, 256, 3) | 0 |
conv2d (Conv2D) | (32, 256, 256, 32) | 896 |
max_pooling2d (MaxPooling2D) | (32, 127, 127, 3) | 0 |
conv2d_1 (Conv2D) | (32, 125, 125, 64) | 18496 |
max_pooling2d_1 (MaxPooling2D) | (32, 62, 62, 64) | 0 |
conv2d_2 (Conv2D) | (32, 60, 60, 64) | 36928 |
max_pooling2d_2 (MaxPooling2D) | (32, 30, 30, 64) | 0 |
conv2d_3 (Conv2D) | (32, 28, 28, 64) | 36928 |
max_pooling2d_3 (MaxPooling2D) | (32, 14, 14, 64) | 0 |
conv2d_4 (Conv2D) | (32, 12, 12, 64) | 36928 |
max_pooling2d_4 (MaxPooling2D) | (32, 6, 6, 64) | 0 |
conv2d_5 (Conv2D) | (32, 4, 4, 64) | 36928 |
max_pooling2d_5 (MaxPooling2D) | (32, 2, 2, 64) | 0 |
latten (Flatten) | (32, 256) | 0 |
dense (Dense) | (32, 64) | 16448 |
dense_1 (Dense) | (32, 3) | 195 |
Total params: 183,747 Trainable params: 183,747 Non-trainable params: 0 |
This process is the last process of all. The testing process is carried out to test how precise the classification is by assessing the index generated using the CNN method. For more details can be seen in Figure 2.
Gambar 2. testing process
The model evaluation process is carried out by calculating accuracy, this is the end of the study. Accuracy in this study is the result used to measure the success of the CNN model in detecting mango leaf images. Calculating accuracy is shown in the equation
1)
In this process is the process of image identification using a model that has been completed.
3. RESULTS AND DISCUSSION
The data is divided into 3 subsets with a ratio of 80:10:10, namely:
80 % training data: Data set to be used during training,
10% validation data: The data set to be tested during training, and
10% test data: The dataset to be tested after we have trained the model.
Before processing an image to the network, it first resizes it to the desired size. Also, to improve model performance, it is necessary to normalize the image pixel values (in the range of 0 and 1 by dividing by 256). This should happen during training as well as inference. Therefore we can add it as a layer in our Sequential Model .
the test results show an accuracy of 95% for training data and 98% for validation data. It can be seen in Figure 3 for the process of testing the model and in Figure 4 for the accuracy graph produced by the model.
Gambar 3. Hasil uji coba model
Gambar 4. Grafik hasil uji coba model
2. Image Identification
The CNN method utilizes the convolution layer by moving a filter of a certain size into an image, then breaking it into small parts with the same convolution layer, the convolution value is entered into a new array that will be used by the neural network to identify an image. The results of identifying manga leaf images can be seen in Figure 5.
Figure 5. Image identification results
4. CONCLUSION
Conclusion from the results of the study using the CNN method by dividing the data into 3 subsets, where 80% of training data, 10% validation and 10% test, obtains accuracy from the testing process shows the number 95%, and the accuracy value obtained from the validation process shows the number 98 %. So it can be concluded that the Convolution Neural Network (CNN) algorithm can detect diseases in mango leaves with good accuracy results.