Source-linked AI summary
Vision Transformers in Precision Agriculture: A Comprehensive Survey
Saber Mehdipour, Seyed Abolghasem Mirroshandel, Seyed Amirhossein Tabatabaei
TL;DR
Plant disease detection matters for crop health and agricultural livelihoods, but traditional inspection and machine-learning approaches have limitations. This survey reviews ViTs in precision agriculture and finds potential across agricultural tasks, while noting that data and computational challenges remain.
Problem
Plant disease detection affects crop yields, food security, and farmers’ economic well-being, while manual inspection and conventional machine learning have limitations.
Source: §1 · p. 1Method
The survey analyzes 44 peer-reviewed studies on ViTs in precision agriculture and reviews their challenges and open research issues.
Source: §1 · p. 3Results
The reviewed literature shows ViT potential across disease identification, yield prediction, and precision agriculture, with most models outperforming or complementing traditional methods.
Source: §6 · p. 25Takeaways & Limitations
The survey concludes that ViTs, alone or in hybrid frameworks, are poised to play a pivotal role in future agricultural applications.
Source: §6 · p. 25ViTs’ data demands and costly self-attention, especially for high-resolution images, constrain use where labeled data, memory, processing power, or fast responses are limited.
Source: §5.2 · pp. 22–23
Abstract
from arXiv · showhide
Detecting plant diseases is a crucial aspect of modern agriculture, as it plays a key role in maintaining crop health and increasing overall yield. Traditional approaches, though still valuable, often rely on manual inspection or conventional machine learning techniques, both of which face limitations in scalability and accuracy. Recently, Vision Transformers (ViTs) have emerged as a promising alternative, offering advantages such as improved handling of long-range dependencies and better scalability for visual tasks. This review explores the application of ViTs in precision agriculture, covering a range of tasks. We begin by introducing the foundational architecture of ViTs and discussing their transition from Natural Language Processing (NLP) to Computer Vision. The discussion includes the concept of inductive bias in traditional models like Convolutional Neural Networks (CNNs), and how ViTs mitigate these biases. We provide a comprehensive review of recent literature, focusing on key methodologies, datasets, and performance metrics. This study also includes a comparative analysis of CNNs and ViTs, along with a review of hybrid models and performance enhancements. Technical challenges such as data requirements, computational demands, and model interpretability are addressed, along with potential solutions. Finally, we outline future research directions and technological advancements that could further support the integration of ViTs in real-world agricultural settings. Our goal with this study is to offer practitioners and researchers a deeper understanding of how ViTs are poised to transform smart and precision agriculture.
1 Introduction
This introduction motivates Vision Transformers (ViTs) as a promising approach to agricultural image analysis and identifies a gap in comprehensive coverage of their precision-agriculture applications. It outlines a survey of the literature, model biases, challenges, and future directions.
1 Introduction
- Plant diseases threaten crop yields, food security, and farmers’ economic well-being, while manual inspection and conventional machine learning have practical limits.Manual diagnosis is time-consuming and inconsistent; conventional methods depend on manual feature extraction and struggle to generalize across environmental conditions.Source: §1 · p. 1
- ViTs offer a flexible alternative to CNNs for image analysis by modeling long-range context with fewer assumptions about input structure.The introduction contrasts this with CNN locality and spatial hierarchies, which can limit capture of global contextual information.Source: §1 · p. 2
- The authors identify a gap in comprehensive analysis of ViTs for precision agriculture, despite growing interest in this emerging research area.Some existing reviews introduce ViTs but do not deeply evaluate agricultural architectures or performance benchmarks.Source: §1 · pp. 2–3
- The survey analyzes 44 peer-reviewed studies, examines inductive biases, and identifies current challenges, open issues, and future research directions.It also reviews Transformer and ViT architectures and their functionality.Source: §1 · p. 3
2.1 Transformer
The Transformer uses self-attention to model long-range relationships while processing sequence elements in parallel. Its encoder–decoder structure, attention computation, and multiple parallel attention heads form the architectural basis described here.
2.1 Transformer
- Self-attention lets the Transformer process sequence tokens simultaneously and capture long-range relationships, addressing limits in dependency modeling and parallelization.The Transformer’s encoder and decoder are built from layers of self-attention and feed-forward networks.Source: §2.1 · p. 3
2.1.1 Encoder-Decoder structure
- The encoder turns an input sequence into contextual representations that the decoder uses to generate an output sequence.The encoder–decoder structure is used for tasks such as machine translation; GPT is described as a decoder-only variant.Source: §2.1.1 · p. 3, Figure 1 · p. 4
2.1.2 Self-Attention mechanism
- Self-attention scales query–key dot-product scores, normalizes them with softmax, and uses the resulting weights to combine value vectors.The resulting representations mix the input values according to the attention paid to each key.Source: §2.1.2 · p. 4, Figure 2 · p. 5
2.1.3 Multi-Head Attention
- Multi-head attention applies separate learned query, key, and value projections in parallel, then concatenates and linearly projects the head outputs.The parallel heads attend to different parts of the input from different representation subspaces.Source: §2.1.3 · pp. 4–5, Figure 3 · p. 5
2.2 Vision Transformer
ViT applies Transformer processing directly to image-patch sequences, enabling global context modeling. Its pipeline embeds patches, adds positional information, processes them through encoder layers, and maps a classification token to class scores.
2.2 Vision Transformer
- ViT applies self-attention across image patches to capture long-range dependencies and contextual relationships, rather than requiring convolutional networks.The architecture adapts the Transformer from NLP to computer vision by treating fixed-size image patches as tokens.Source: §2.2 · pp. 5–6, Figure 4 · p. 6
2.2.1 Patch Embedding
- Each image patch is flattened and linearly projected into a D-dimensional embedding for Transformer processing.The projection uses a trainable matrix E.Source: §2.2.1 · p. 6
2.2.2 Positional Embedding
- Positional embeddings are added to patch embeddings to retain spatial information in the input sequence.The positional embeddings may be learned or fixed.Source: §2.2.2 · p. 7
2.2.3 Transformer Encoder
- Encoder layers combine multi-head self-attention and position-wise feed-forward networks, with residual connections and layer normalization following each sub-layer.Self-attention forms weighted combinations of sequence elements; the feed-forward network is applied identically and separately at each position.Source: §2.2.3 · p. 7
2.2.4 Classification Head
- For classification, a learnable class token is prepended, and its final encoder embedding is passed through an MLP to produce class scores.The output logits have one entry for each of the K classes.Source: §2.2.4 · p. 7
3 Inductive biases in ML and DL Models
Inductive biases are built-in assumptions that guide learning toward particular solutions. The section contrasts CNNs’ locality and weight sharing with ViTs’ global attention, then reviews strategies for adding local structure or teacher knowledge to ViTs.
3.1 Definition of Inductive Biases
- Inductive biases are built-in assumptions that guide learning toward particular solutions and can aid generalization, especially with limited data.In CNNs, examples include locality and translation equivariance, which shape how image features are learned.Source: §3.1 · p. 8
3.2 Inductive Biases In CNNs and ViTs
- CNN locality and weight sharing reduce parameters and support generalization, but locality constrains their capture of long-range dependencies.These biases can be helpful with limited labeled data, while their benefits tend to diminish with very large datasets.Source: §3.2 · p. 8
- ViTs use global self-attention to integrate information across image regions, but their weaker built-in biases can hinder fine-grained learning and make training data- and hyperparameter-sensitive.With sufficient data and good optimization, ViTs can implicitly learn some CNN-like priors; they remain less suited to data-scarce regimes.Source: §3.2 · pp. 8–9
3.3 Strategies to Mitigate the Lack of Inductive Biases in ViTs
- Convolutional patch embedding or a convolutional stem adds local feature processing to ViTs, while hybrid models combine CNN spatial biases with Transformer global modeling.Convolutional patch embedding preserves local image structure; a CNN backbone can instead extract low-level features before Transformer processing.Source: §3.3 · p. 9
- CNN-teacher distillation transfers inductive biases to a ViT student and can improve performance, particularly on smaller datasets.Hierarchical ViTs instead process local windows and progressively merge or downsample tokens, building from local features toward global representations.Source: §3.3 · p. 9
4 Applications of ViTs in Precision Agriculture
This section surveys Vision Transformer applications in precision agriculture, spanning pure models and CNN–Transformer hybrids for disease, pest, weed, fruit, and crop-stage recognition. It also examines hybrid approaches to disease diagnosis and their adaptations for complex imagery, interpretability, robustness, data scarcity, and practical deployment.
4.1 Pure Models
- On strawberry disease classification, the ViT model achieved 92.7% test accuracy and F1-score, while its PlantVillage accuracy was 98.9%.The model used transfer learning and fine-tuning with added ReLU, batch normalization, dropout, and softmax layers; data augmentation improved its comparative performance.Source: §4.1 · p. 10
- GreenViT achieved 100% accuracy on PlantVillage, 98% on DRLI, and 99% on PC, using 21.65 million parameters versus ViT-Base’s 86 million.Its patch-based design was presented as an efficient alternative to models including VGG16, MobileNetV1, and ViT-Base, with potential suitability for edge devices.Source: §4.1 · p. 10
- SwinT achieved 87.43% precision for fruit object detection, while its moving-window self-attention supported feature extraction for fruit ripeness classification.The study used self-built apple and pear datasets and also combined Transformer and YOLO modules to classify ripeness stages.Source: §4.1 · p. 10
- Pure ViTs also address data and deployment constraints: multispectral ViT-B16 transfer learning reached 93.71% training and 90.02% testing accuracy across five crops.Other applications include residual-distilled rice disease recognition, with an 89% F1-score and 92% top-1 accuracy, and LEViT, which uses Grad-CAM for visual explanations. Fine-grained LeafViT and smartphone-based tomato detection target edge and field use; IEM-ViT masks 75% of input image data for tea disease recognition, including on low-quality images.Source: §4.1 · pp. 11–12
4.2 Hybrid Models
- For WRCD, the ViT-based model achieved a 100% F1-score at 200×200 resolution; on PlantVillage, it achieved a 98.77% F1-score, surpassing CNN-based architectures.The study also found that CNN-attention hybrids were faster than pure ViTs and more accurate than CNN-only models, balancing accuracy and speed.Source: §4.2 · p. 13
- The enhanced MaxViT-based maize model achieved 99.24% test accuracy, outperforming 28 CNN and 36 ViT architectures in accuracy and inference speed.It adds Squeeze-and-Excitation blocks and Global Response Normalization to a combined PlantVillage, PlantDoc, and CD&S maize dataset.Source: §4.2 · p. 14
- Hybrid methods target robustness and efficiency: CST maintained 0.795 accuracy with 30% salt noise, while HPMA achieved 98.02% testing accuracy on its 40-class dataset.CST outperformed ResNet50 and LeViT-192 under salt noise but exceeded 48 million parameters. HPMA combines max and min pooling with ViT techniques; its testing accuracies were 98% on a new 10-class dataset and 95.98% on a 102-class dataset. Other hybrids use convolutional feature extraction with Transformer attention, including SCSA-Transformer (99.10% accuracy) and efficient potato-disease model EfficientRMT-Net.Source: §4.2 · pp. 13–15
- The paddy disease model achieved 98.74% accuracy, 98.18% F1-score, and 99.49% AUC on Paddy Doctor, outperforming DenseNet169, ResNet50, and SwinT.It combines multi-scale local and global feature extraction with weakly supervised lesion localization to prioritize discriminative regions.Source: §4.2 · p. 14
- The hybrid model in achieved 99.62% recognition accuracy on PlantVillage and balanced accuracies of 96.58% and 95.97% on two complex-background datasets.A separate lightweight CNN–BEiT model used LIME, SLIC segmentation, and attention mapping to explain rice-disease predictions and was described as suitable for resource-constrained real-time use.Source: §4.2 · pp. 16–17
- TLMViT reported 98.81% validation accuracy on PlantVillage and 99.86% on Wheat Rust, improvements of 1.11% and 1.099% over transfer-learning models without ViT.It combines pretrained-CNN and ViT feature extraction with augmentation and an MLP classifier; FOTCA instead combines AFNO with convolutional down-sampling and learnable Fourier positional features.Source: §4.2 · p. 17
- COFFORMER achieved 98.14% DSC and 97.98% mIoU for segmentation, plus 99.1% accuracy and 99.32% F1-score for disease-type classification.Its dual paths combine lesion segmentation and disease-type and severity classification for real-time, explainable diagnosis.Source: §4.2 · p. 17
- TSTC was proposed for simultaneous and separate classification of plant diseases and severity, using three feature-extraction branches that integrate SwinT with compact bilinear pooling for feature fusion.Source: §4.2 · p. 18
- TSTC is a multitask triple-branch SwinT model using compact bilinear pooling for simultaneous disease and severity classification, while LDI-NET uses a single-branch architecture for plant type, leaf disease, and severity identification.Source: §4.2 · p. 18
- The model paired convolutional layers for spatial features with a Transformer for global feature extraction, reducing parameter count by nearly half versus SwinT and enabling lighter deployment and faster training.ConvViT used overlapping patch embeddings and alternating convolutional and Transformer layers, achieving 98.78% accuracy on a custom dataset of 25,168 images covering six kiwifruit leaf diseases.Source: §4.2 · pp. 16, 19
- Evaluated on five datasets, ConViTX achieved 93.02% accuracy on the custom maize dataset, matching the best competitors while attaining a 2% higher AUC.Source: §4.2 · p. 19
- RepAgrViT, with 9.6M parameters, achieved 98.54% average accuracy across the Coffee Leaf, Plant Pathology, and Rice Leaf Disease datasets, scoring 98.03%, 96.99%, and 98.78%, respectively.Source: §4.2 · p. 20
5 Findings and Open Challenges
The review finds that ViTs and CNN–ViT hybrids perform strongly across agricultural tasks, while data scarcity, computational demands, limited interpretability, and disease-severity assessment remain open challenges.
5.1 Key Findings
- ViTs often outperform traditional CNNs in plant disease detection, and their long-range relationships support identification in complex environments.The review also reports benefits for crop monitoring and automated plant-health monitoring.Source: §5.1 · p. 22
- Hybrid CNN–ViT models combine local feature extraction with global context and are reported to improve classification accuracy and robustness.The review identifies CNN and ViT combinations as a promising approach for agricultural challenges.Source: §5.1 · p. 22
- Self-attention dynamically weights image regions, helping ViTs capture subtle leaf symptoms and local and global context without manual feature extraction.The review contrasts this with CNNs’ uniform convolutions, which can miss small but significant features.Source: §5.1 · p. 22
- Transfer learning can improve performance with limited data, while pruning, sparse multiplication, and distillation target efficiency and smaller models.The review describes pretraining on large datasets followed by fine-tuning on smaller disease-specific datasets.Source: §5.1 · p. 22
5.2 Open Challenges
- ViTs’ limited built-in spatial and local-pattern biases make them data-hungry, while agricultural datasets are costly to collect and annotate.Table 3 reports dataset-use frequency and groups datasets as Custom, Self-built, or From Kaggle.Source: §5.2 · pp. 22–23, Table 3 · p. 24
- High-resolution imagery increases ViTs’ memory and processing demands, complicating edge deployment; performance may also vary across crops, climates, and farming practices.The review identifies pruning, sparse multiplication, distillation, and CNN–ViT hybrids as possible efficiency approaches.Source: §5.2 · p. 23
- ViT predictions can be difficult to interpret, leaving farmers and agronomists uncertain about which features drive a decision.Grad-CAM can visualize important image regions, but the review calls for deeper insight into prediction rationale.Source: §5.2 · p. 23
- Most studies detect disease presence or absence rather than severity, although severity matters for crop yield and treatment planning.The review calls for severity-aware labels and model outputs.Source: §5.2 · p. 23
6 Conclusion
The conclusion traces agricultural ViTs from standalone Transformers to hybrids that combine CNN and Transformer strengths. It reports promise across agricultural tasks while identifying practical challenges and research priorities.
- The review traces agricultural ViTs from vanilla Transformers to hybrid architectures that combine CNN and Transformer strengths.It describes ViTs as a more adaptable and scalable alternative to conventional deep-learning approaches, with hybrids reintroducing inductive biases.Source: §6 · pp. 24–25
- Reviewed ViTs show potential across disease identification, yield prediction, and precision agriculture, often outperforming or complementing traditional methods.Source: §6 · p. 25
- Data scarcity, computational requirements, and task-specific customization remain challenges; future work should target efficiency, domain adaptation, and robust annotated datasets.Source: §6 · p. 25