← Back to list

Enhancing MobileNetV2 Accuracy with Dataset Augmentation Using DCGAN for Corn, Cassava, Sugarcane…

Introduction

Fieter Brain Pasaribu · 2024-07-12 17:40 · 0 claps · 3.8 min read
#deeplearing #dcgan #plants #mobilenetv2 #image-classifier
Open on Medium ↗

Enhancing MobileNetV2 Accuracy with Dataset Augmentation Using DCGAN for Corn, Cassava, Sugarcane, and Rice Plants

Introduction

In the field of agriculture, plant classification is crucial for effective land monitoring and management. One of the major challenges in developing classification models is the limited number of images in the dataset. To address this issue, we utilized Generative Adversarial Network (GAN), specifically Deep Convolutional GAN (DCGAN), to augment the dataset of corn, cassava, sugarcane, and rice plants. Interestingly, even though the images generated by DCGAN are not entirely realistic, this data augmentation still significantly improved the accuracy of the MobileNetV2 model.

Dataset and Model

The dataset used consists of:

  • Cassava: 58 images
  • Corn: 58 images
  • Sugarcane: 65 images
  • Rice: 64 images

All images were resized to 224x224 pixels. This dataset was collected manually by our team. MobileNetV2 was chosen for classification due to its efficiency in resource usage and good performance on mobile devices.

Introduction to DCGAN

DCGAN is a type of GAN that uses convolutional networks to generate images. Although the images generated by DCGAN in this study are not entirely realistic, they are sufficiently similar to the original images for data augmentation purposes. This is intriguing because, despite the synthetic images not being perfectly realistic, the augmentation still led to significant improvements in the model’s performance.

Methodology

Dataset Preparation

The original dataset consisted of images of cassava, corn, sugarcane, and rice, all resized to 224x224 pixels.

DCGAN Architecture

The DCGAN used includes:

  • Generator: Convolutional and upsampling layers.
  • Discriminator: Convolutional layers.
  • Training Parameters:
  • Latent dimension: 128
  • Batch size: 8
  • Epochs: 1000

DCGAN Training Process

DCGAN was trained using the original images to generate 100 synthetic images per class. Although the generated images are not perfectly realistic, evaluation metrics such as Frechet Inception Distance (FID) and Inception Score (IS) showed FID around 0.1 and IS around 1.1, indicating that the quality of the synthetic images was adequate for augmentation.

Dataset Augmentation

The images generated by DCGAN were added to the original dataset, increasing the number of training samples and providing additional data for the model to learn from.

Fine-tuning MobileNetV2

MobileNetV2 was fine-tuned as follows:

  1. Freeze Feature Extractor: Train the classification head, which was modified to have 4 classes.
  2. Unfreeze Feature Extractor: Retrain the entire model with the feature extractor unfrozen.

Model Evaluation

To evaluate the quality of the images generated by DCGAN, we used FID and IS metrics. The MobileNetV2 model’s accuracy was measured before and after dataset augmentation to assess performance improvements.

Results and Discussion

Model Accuracy

  • Before Augmentation: The initial accuracy of MobileNetV2 was 89%.
  • After Augmentation: The accuracy of MobileNetV2 increased to 92% following data augmentation, despite the generated images not being entirely realistic.

Accuracy Graph

Accuracy graph before augmentation

Accuracy graph before augmentation

Accuracy graph after augmentation

Accuracy graph after augmentation

Image Visualization

Here are examples of original images versus DCGAN-generated images:

Figure 1: Example of a cassava plant.

DCGAN VS REAL

DCGAN VS REAL

Figure 2: Example of an image of a corn plant.

DCGAN VS REAL

DCGAN VS REAL

Figure 3: Example of a picture of a sugarcane plant.

DCGAN VS REAL

DCGAN VS REAL

Figure 4: Example of an original image of a rice plant.

DCGAN VS REAL

DCGAN VS REAL

Analysis

Although the synthetic images produced by DCGAN are not completely realistic, the data augmentation proved effective. The significant increase in MobileNetV2 accuracy demonstrates that, despite the imperfections in the generated images, they still provide valuable additional information for the model.

Conclusion

This study demonstrates that using DCGAN for augmenting the dataset of corn, cassava, sugarcane, and rice plants can significantly enhance the accuracy of the MobileNetV2 model. Even though the generated images are not entirely realistic, data augmentation using DCGAN offers tangible benefits in improving model performance. Future research could explore additional augmentation techniques or practical applications in the field.

References

  1. Goodfellow, I., et al. (2014). Generative Adversarial Nets. arXiv preprint arXiv:1406.2661.
  2. Sandler, M., et al. (2018). MobileNetV2: Inverted Residuals and Linear Bottlenecks. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR).
  3. Radford, A., Metz, L., & Chintala, S. (2015). Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. arXiv preprint arXiv:1511.06434.

Source code and dataset

github: https://github.com/Fieter955/DCGAN-MobileNet_v2.git


메타데이터
post_id
0d450f8a24bf
slug
enhancing-mobilenetv2-accuracy-with-dataset-augmentation-using-dcgan-for-corn-cassava-sugarcane-0d450f8a24bf
url
https://medium.com/@fieterbrain955/enhancing-mobilenetv2-accuracy-with-dataset-augmentation-using-dcgan-for-corn-cassava-sugarcane-0d450f8a24bf
canonical_url
https://medium.com/@fieterbrain955/enhancing-mobilenetv2-accuracy-with-dataset-augmentation-using-dcgan-for-corn-cassava-sugarcane-0d450f8a24bf
author_url
https://medium.com/@fieterbrain955
status
ok
fetched_at
2026-08-18 13:54:05