Skip to main content
QUICK REVIEW

[Paper Review] Vision Transformers For Weeds and Crops Classification Of High Resolution UAV Images

Reenul Reedha, Eric Dericquebourg|arXiv (Cornell University)|Sep 6, 2021
Smart Agriculture and AIAgricultural and Biological Sciences43 references8 citations
TL;DR

This paper proposes using Vision Transformers (ViT) for classifying high-resolution UAV images of weeds and crops—red beet, off-type beet, parsley, and spinach—without convolutional operations. Trained on limited labeled data, ViT achieves 99.8% top-1 accuracy, outperforming state-of-the-art CNNs like ResNet and EfficientNet, especially with small datasets, demonstrating ViT's superior generalization and efficiency in agricultural image classification.

ABSTRACT

Crop and weed monitoring is an important challenge for agriculture and food production nowadays. Thanks to recent advances in data acquisition and computation technologies, agriculture is evolving to a more smart and precision farming to meet with the high yield and high quality crop production. Classification and recognition in Unmanned Aerial Vehicles (UAV) images are important phases for crop monitoring. Advances in deep learning models relying on Convolutional Neural Network (CNN) have achieved high performances in image classification in the agricultural domain. Despite the success of this architecture, CNN still faces many challenges such as high computation cost, the need of large labelled datasets, ... Natural language processing's transformer architecture can be an alternative approach to deal with CNN's limitations. Making use of the self-attention paradigm, Vision Transformer (ViT) models can achieve competitive or better results without applying any convolution operations. In this paper, we adopt the self-attention mechanism via the ViT models for plant classification of weeds and crops: red beet, off-type beet (green leaves), parsley and spinach. Our experiments show that with small set of labelled training data, ViT models perform better compared to state-of-the-art CNN-based models EfficientNet and ResNet, with a top accuracy of 99.8\% achieved by the ViT model.

Motivation & Objective

  • Address the challenge of accurate weed and crop classification in high-resolution UAV imagery for precision agriculture.
  • Overcome limitations of CNN-based models, such as high computational cost and reliance on large labeled datasets.
  • Evaluate the performance of ViT—a self-attention-based transformer model—on small, real-world agricultural image datasets.
  • Demonstrate the feasibility and superiority of ViT in low-data regimes for plant classification tasks.
  • Provide a foundation for future integration of ViT into object detection pipelines for automated weed control systems.

Proposed method

  • Divide high-resolution UAV RGB images into non-overlapping patches (16×16 pixels) for input to the Vision Transformer.
  • Apply class and position embeddings to each patch to preserve spatial and class information in the sequence input.
  • Process the patch sequence through a standard transformer encoder with multi-head self-attention and feed-forward networks.
  • Use a classification head on the [CLS] token output to predict plant species (red beet, off-type beet, parsley, spinach).
  • Train the ViT model end-to-end using cross-entropy loss with 5-fold cross-validation to ensure robustness.
  • Compare ViT-B/16 against state-of-the-art CNNs (ResNet50, EfficientNet-B0, EfficientNet-B1) under identical training and evaluation protocols.

Experimental results

Research questions

  • RQ1Can Vision Transformers achieve superior classification accuracy compared to CNN-based models on high-resolution UAV images of crops and weeds?
  • RQ2How does the performance of ViT scale with decreasing amounts of labeled training data compared to CNNs?
  • RQ3Does the self-attention mechanism in ViT enable better feature learning and generalization in agricultural image classification than local convolutional operations?
  • RQ4Can ViT maintain high accuracy even with limited training data, making it suitable for data-scarce agricultural applications?
  • RQ5What is the relative robustness of ViT-B/16 compared to ResNet and EfficientNet variants when training data is reduced?

Key findings

  • The ViT-B/16 model achieved a top-1 accuracy of 99.8% on the test set when trained with 12,844 labeled images, outperforming ResNet50 (99.50%), EfficientNet-B0 (98.78%), and EfficientNet-B1 (98.98%).
  • With only 3,211 training images, ViT-B/16 maintained an F1-Score of 99.63%, significantly outperforming ResNet50 (97.54%), EfficientNet-B0 (96.53%), and EfficientNet-B1 (95.91%).
  • The performance drop of ViT-B/16 was minimal (from 99.80% to 99.14%) when training data was reduced from 12,844 to 4,535 images, while CNNs showed steeper declines.
  • EfficientNet-B1 exhibited the largest performance drop (3.07%) when training data was reduced from 12,844 to 3,211 images, indicating poor data efficiency.
  • ViT-B/16 showed the most stable performance across all data regimes, demonstrating superior data efficiency and robustness in low-data settings.
  • The results confirm that ViT-B/16 generalizes better than CNNs in agricultural image classification, especially when labeled data is scarce.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.