Materials and Methods
I will discuss the tools and methods we applied for measurement. I worked with a raw data file that included, exactly, 1624 photos. These were marked 1 through 4, marking the leaf's disease class. Here, sequential models have been used to teach a machine. The Python tools numpy, pandas, skit learn, matplotlib, seaborn, TensorFlow, keras, etc. were used with the Windows OS. Colab, a free Python package from Google built for use in information science and artificial intelligence tasks, was used for all development and review. To build a reliable tomato leaf disease detection system for Bangladeshi agriculture, this study uses CNN and ResNet50, MobileNetV2, DensNet201, MobileNetV3 and Vgg19 deep learning models. The following parts will cover model building, training, testing data, and analysis to help readers understand the study topic and tools.
Data Collection
To identify tomato leaf disease using CNNs, data collection was carefully planned. The study used secondary sources, getting pictures from various tomato farms using a cell phone in daylight. Initially, 400 pictures of four disease types were gathered, which were insufficient for training. To solve this, data expansion was performed, growing the collection to 1,626 pictures. This expanded sample helps the machine learn key disease traits more effectively. The goal is to help farmers in finding and learning different disease traits.
Figure 1.
Three Leaves Diseases and Healthy Leave.
Figure 1.
Three Leaves Diseases and Healthy Leave.
This study offers statistical analysis to assess the performance of CNN models in identifying tomato leaf diseases. Key measures include accuracy, precision, and memory. I tried various architectures—CNN, MobileNetV2, MobileNetV3, ResNet50, DenseNet201, and VGG19—to improve accuracy. The collection includes 1,626 pictures across four classes: Bacterial Spot, Early Blight, Mosaic Virus, and Healthy. All photos were adjusted to 224×224 pixels. Data was split into 70% for training, 20% for testing, and 10% for confirmation.
Table 1.
Several photos and the class index for each of those 4 classes.
Table 1.
Several photos and the class index for each of those 4 classes.
| Class Name |
Class Index |
No. of Image |
| Bacterial_spot |
1 |
407 |
| Early_blight |
2 |
406 |
| Mosaic_virus |
3 |
407 |
| Healthy |
4 |
406 |
Dataset Preparation
The method starts with the planning and collection of the "TomatoLeafDisease- 2023" dataset, which is representative and diverse. This dataset includes carefully chosen high-resolution pictures of tomato plants in both healthy and sick states. The named and tagged collection offers important ground truth data for CNN model training.
Data Augmentation Techniques
To improve the dataset's potential for extension, data expansion methods are used on it. Rotations flips, and zooms are some of these changes that add variance to the model, avoiding overfitting and improving its capacity to react to a variety of real- world events.
CNN Architecture Selection
A important first step is picking a good CNN design. Modern designs like ResNet, MobileNet, VGG19, DenseNet, and custom models are taken into consideration. The building design needs to show balance between complexity and effectiveness, fitting the subtleties of tomato leaf disease patterns.
Figure 2.
CNN Architecture Procedure.
Figure 2.
CNN Architecture Procedure.
Transfer Learning
The suggested method uses big datasets to leverage pre-trained CNN models, using transfer learning. This method expedites the training process and improves the model's ability to identify important traits from pictures of tomato leaves. Pre-trained models are changed to ensure that they are tailored to the goal of illness identification.
ResNet50
Convolutional neural networks (CNNs) like ResNet50 are part of the ResNet (Residual Network) family of neural networks. Its 50 levels of neural network design describe its depth. The number of layers, or "50" in ResNet50, suggests a significant depth that allows the model to pick up on complex features and trends in the data. The idea of residual learning, in which information can move straight between layers thanks to fast links, was first presented by ResNet designs. This helps to train very deep networks and lowers the problem of fading slopes.
Figure 3.
ResNet50 Layer Architecture.
Figure 3.
ResNet50 Layer Architecture.
DensNet201
DenseNet201 is a deep CNN model with 201 layers, known for its tightly connected design. Each layer gets information from all earlier layers, improving feature usage, gradient flow, and reducing the disappearing gradient problem. It works well in jobs like picture analysis and object recognition. Although computationally expensive, its design allows strong generalization and accurate pattern recognition, making it ideal for complex visual tasks.
Figure 4.
DensNet201 Layer Architecture.
Figure 4.
DensNet201 Layer Architecture.
MobileNet V2
MobileNetV2 is a lightweight CNN framework intended for mobile and edge devices, combining speed and accuracy. It improves on the original MobileNet by using inverted residuals with linear limits to record fine-grained features. The model uses depth-wise separable convolutions and lowers dimensions to improve efficiency. Its adjustable design includes width and resolution boosters, improving freedom across various apps.
Figure 5.
MobileNetV2 Layer Architecture.
Figure 5.
MobileNetV2 Layer Architecture.
MobileNet V3
MobileNetV3 builds on the success of MobileNet and MobileNetV2, hoping to improve speed and accuracy for mobile and edge devices. It likely includes design changes, better cutting and compression methods, and task-specific tweaks for apps like picture classification and object recognition. MobileNetV3 also studies compression and improved activation functions to further improve efficiency. For the latest changes, checking current study and official sites is suggested.
Figure 6.
MobileNet V3 Architecture.
Figure 6.
MobileNet V3 Architecture.
Model Training and Validation
A part of the prepared dataset is kept away for confirmation and used to train the CNN model. To reduce the loss function, training involves repeatedly changing the model's properties. By confirming the model's performance on data not noticed during training, validation guards against overfitting and ensures generalizability.