Detection of Various Diseases in Fruits and Vegetables with the Help of Different Deep Learning Techniques

— Fruit and vegetable diseases have an important place in the food sector in terms of sustainable agricultural policies. Therefore, these diseases reduce the productivity of the crop and adversely affect the food supply. These deteriorations in fruits and vegetables are not desired by the consumer. When these deteriorations are encountered, it not only causes loss of reputation for tradesmen, but also causes serious economic losses. In this context, it is thought that the use of deep learning techniques will be useful in detecting diseased products in agriculture. While the fruit or vegetable is still in the harvest period, it can be determined whether the product is diseased or not by looking at the leaves. Thus, the precautions that can be taken during the harvest period will ensure the production of quality and healthy products. In this study, it was aimed to detect 10 different diseases in tomato and strawberry using two different deep learning techniques (CNN and Resnet50). Our data set consists of 1055 tomato and 1238 strawberry images. In the next step, a total of 2293 images were increased to 13758 images by using image augmentation techniques. As a result, 67.1% success was achieved with the help of CNN architecture. In the following periods, it is aimed to obtain better performance rates with better and sufficient hardware by using an isolated and balanced distributed data set.


I. INTRODUCTION
EGETABLES AND fruits, one of the most important issues in the food industry, constitute an important and large part of the plant production cycle.Fruits and vegetables getting sick is one of the factors that the consumer does not want to encounter, which is the end point of consumption.When this situation occurs, the tradesman who offers the diseased product to the end consumer loses his reputation in the eyes of the consumer.These sick products, which are not preferred by the end consumer, return to the tradesmen as a serious economic loss.Producers who cannot carry out the necessary intervention and precaution activities suffer economic losses due to increasing product losses.This damage is reflected from manufacturers to retailers and food wholesalers.Spoils occurring in fruit and vegetable products are generally at the expense of the final consumer.It causes the product to be cautious to the point where it spoils.As with many plant products, vegetable and fruit diseases also cause deformities.Similar to this situation, image processing techniques used in the detection of various diseases such as tumor cell detection; Just as it detects diseases based on shape changes in organs in the human body, this condition can also be detected in fruits and vegetables.Thus, it is thought that precautions can be taken during the production phase [1].There are very limited resources in the literature for disease detection of fruits and vegetables.One of the first studies in the field of disease detection of fruits and vegetables was carried out by Wen and Tao (1997).It has developed a system that grades fruit according to color, surface and size defects in accordance with OECD standards in order to estimate fruit quality and offer fresh market opportunities.In this proposed study, they developed a system that automatically grades color and size and thus separates damaged fruits.Their study is based on a model that assumes that fruits and vegetables have a spherical structure with diameters that vary depending on their size and shape.Additionally, it can analyze more than five vegetables or fruits per second for each grade [2].The first steps in the field of disease detection and quality control in vegetables and fruits represent great progress for the food industry in general.In the 21st century, where technology is increasingly advanced, the study of Wen and Tao (1997) was the first step in this field.In the food industry, effective solutions have continued to be developed to control and continuously improve the quality of fruits and vegetables produced.Deep learning and artificial intelligence (AI) technologies have become the most important tools used in the detection of fruit diseases in recent years.Improved image processing techniques and deep learning algorithms allow producers and retailers to evaluate the quality and condition of fruits much more The main purpose of this study is to easily detect fruit and vegetable diseases.For the purpose of the study, ResNet50 and Convolutional Neural Networks (CNN), which are deep learning architectures, were used and a system that can detect disease was designed.The performance rates of these two architectures were compared and it was determined that the most successful result was obtained in the model trained using Convolutional Neural Networks (CNN).The contributions of this study, which aims to detect fruit and vegetable diseases, to the literature are as follows; a) Prevention of fruit and vegetable diseases, b) Preventing economic damages from production to the end consumer, c) With the proposed architecture, a new approach has been proposed for strawberry and tomato diseases for the first time.

A. Dataset Collection
In the literature, there are very few studies using image recognition techniques to detect tomato and strawberry diseases together.The reasons for this situation are; the current data set is not sufficient and there is no comprehensive data set to ensure the diversity of the study.In this study, 1055 tomatoes and 1238 strawberries; a total of 2293 images of one type of fruit and one type of vegetable were employed.By applying data augmentatıon operations such as rotation, cropping, zooming, inverting and contrasting to the images in the data set, the total number of images was increased from 2293 to 13758.There are 7 disease classes for strawberry and 3 classes for tomato in the disease data set.These are 3 vegetable diseases for tomatoes: Tomato blight, Tomato leaf mold and Tomato spider mites [8].
For strawberry, it is seen as Strawberry angular leaf spot, Strawberry anthracnose, Strawberry flower blight, Strawberry gray mold, Strawberry leaf spot, Strawberry fruit powdery mildew and Strawberry leaf powdery mildew [9]. Figure 1 shows images for two sample classes.The main difference between these algorithms is number of layers and model structure.

1) Convolutıonal Neural Networks (CNN)
One of the most successful models for feature extraction on image data is Convolutional Neural Networks (CNN).CNN can learn down to the deepest features of images.Pre-trained deep learning models can be used to solve many different problems, especially since they are trained on large and diverse data sets.Slightly tuning ("fine-tuning") the weights of these models to solve a specific problem often makes it possible to achieve high performance with less data.In this case, the final layers of the model are usually rearranged on a problem-specific basis and the model is retrained with fewer iterations on the new data set.The advantage of this approach is to save calculation time and get better results with less data.

2) ResNet50
It is a deep learning architecture frequently used in image detection and classification.ResNet, which has 23 million parameters and consists of approximately 152 layers, aims to improve the bottleneck in learning.Figure 3 shows the "redundant" blocks that provide bottlenecks for ResNET50 and ResNET architectures [12].There are four parameters to evaluate the performance of the models.These; F-1 score, recall, accuracy and precision [13][14].Test results and performance metrics of the CNN and ResNet50 models are as in Table I.Finally; when the images in the test data set are introduced to the proposed model, which has completed the training phase, it detects the relevant disease and prints it on the screen.Figure 8 shows the CNN model screen output that detects an example tomato leaf mold disease.
In this part, the results of two different deep learning architectures are given in Table 1.While the accuracy value of the test data applied to the CNN model was determined as 67.1%;In the Resnet50 model, this value was found to be 52.3%.If we talk about the reasons for the low performance rates of this study; it can be due to that the unbalanced distribution of the data belonging to the classes in the data set, the limited and low number of epochs due to the insufficiency of the video card, the server insufficiency, and the large number of classes in the data set and the similarity of these classes to each other.Moreover, the processing time comparison of CNN and ResNet50 models is shown in Table II.V. CONCLUSION Vegetable and fruit diseases affect all consumers, from the producer to the final consumer.In the proposed work, it was aimed to detect diseases of fruits and vegetables and intervene in the early period, prevent serious economic losses and provide fresh market opportunities to consumers.In this context, CNN and ResNet50 models from deep learning architectures were preferred.In this study, 7 strawberry and 3 tomato disease classes were determined and the data set was used.Disease images were trained on two deep learning models and tested after this training.By making the application prepared in this study ready for real-time tests, it is aimed to create a videobased identification system with better hardware and more distinguishable data sets in the future.In this work, the success of the models employed was compared with each other.These models were prepared for real-time application and more successful results could have been obtained with better hardware by using more isolated data.Moreover, it is envisaged that a video-based detection system can be created to detect vegetable and fruit diseases in mobile systems used in production lines or packaging systems.In addition, by developing the system designed in this study, it is possible to recognize the product in pre-harvest and not yet germinated fruit leaves.An application related to fruits and vegetables that all consumers can use in daily life will be examined comprehensively and it will be determined whether this application works on smartphones and whether it can be used without requiring touch.Such research will make a significant contribution to the prevention of fruit diseases and the economic damage from production to the end consumer.

Fig. 3 .
Fig.3.A deeper residual function building block in the ResNet structure and a"bottleneck" building block in ResNet-50[15]

Fig. 4 .
Fig.4.CNN Model Loss and Accuracy Graphs Again, in this study, there was a model training phase lasting 8 hours in 15 epochs using the ResNet50 model, which is another deep learning architecture.Similarly, testing was carried out with the images in the test data set and a performance of 52.3% was achieved.The loss and accuracy graphs of the training result of the ResNet50 model are given in Figure 5.

Fig. 6 .
Fig.6.Screenshot of real-time sick fruit recognition system Terzi et al. (2023)Diseases with Deep Learning".This method was implemented using a pre-trained AlexNet model and tested on a dataset containing real disease images from the TRB1 region.99.30%accuracy was achieved in the experiments[4].In the study byTerzi et al. (2023), a new CNN model consisting of 15 layers was developed, and the performance rate of the model consisting of 1028 images was obtained as 96.10% [5].Sevli's work (2023), "Detection of Apple Plant Diseases with Deep Learning", includes agricultural sustainability and the importance of deep learning in combating diseases.By applying an ESA-based classification to the data set consisting of 1821 images, 98.76% accuracy was achieved [6].Acar et al. (2022) used various machine learning techniques in the detection of plant diseases caused by pathogens.As a result, they achieved high performance [7].