Skip to content

Low-cost UAV-based crop phenotyping using RGB imagery without GCPs or RTK-GPS. Includes dual-altitude flight strategy, RANSAC-based DEM correction, and pretrained models for plant counting, height estimation, and panicle detection across rice growth stages.

License

Notifications You must be signed in to change notification settings

LUMS-WIT/infrastructure-free-uav-phenotyping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infrastructure-Free UAV Phenotyping Dataset

Paper Status: Submitted to Computers and Electronics in Agriculture

This repository provides code, data, and documentation to support reproducibility and review of our work.

Overview

This repository contains the complete dataset and source code for our paper "UAV-Based Crop Reconstruction and Trait Estimation Using RGB Imagery Without External Geospatial Infrastructure", under review in Computers and Electronics in Agriculture.

We present a low-cost, infrastructure-free UAV phenotyping workflow that enables reliable crop monitoring using only RGB imagery from consumer-grade drones, without Ground Control Points (GCPs) or RTK-GPS. The dataset includes weekly UAV flights over rice fields throughout the 2025 growing season, with phenotypic analysis spanning early, mid, and late growth stages.

Key Features

  • Consumer-grade UAV Platform: DJI Mini 4 Pro (RGB camera only)
  • No External Infrastructure: No GCPs or RTK-GPS required
  • Complete Growing Season: 13 weekly flight missions from August to October 2025
  • Multi-stage Phenotyping: Plant counting, health monitoring, panicle detection, and height estimation
  • High Resolution: Orthomosaics at ~1.85 mm/pixel GSD (6m altitude)
  • DEM Products: Digital Elevation Models at ~5.8 mm/pixel GSD (10m altitude) with RANSAC-based correction
  • Ground Truth Data: Manual canopy height measurements and plant/panicle count validation

Dataset Highlights

Metric Value
Plant Counting Accuracy 94.95%
Panicle Detection Accuracy 91.59%
Height Estimation (Pearson R) 0.876
Height MAE 0.177 m
Field Coverage 2 plots × 30m × 10m
Total Flights 13 dual-altitude missions

Repository Structure

infrastructure-free-uav-phenotyping/
│
├── data/                         # UAV-derived products organized by date
│   ├── 2025-08-13/               # early stage: plant counting & sizing
│   ├── 2025-08-27/               # mid stage: yellow leaf detection
│   ├── 2025-08-28/               # mid stage: yellow leaf detection
│   ├── 2025-09-03/
│   ├── 2025-09-04/               # first corrected DEM acquisition
│   ├── 2025-09-05/               
│   ├── 2025-09-09/               
│   ├── 2025-09-12/               # first ground truth height measurements
│   ├── 2025-09-17/               # panicle detection begins
│   ├── 2025-09-19/               
│   ├── 2025-09-26/               
│   ├── 2025-10-01/               
│   └── 2025-10-03/
│
├── code/                         # processing pipeline and models
│   ├── dem_processing/           # RANSAC-based DEM flattening
│   ├── plant_counting/           # RiceNet implementation
│   ├── panicle_counting/         # YOLOv5 fine-tuned model
│   ├── yellow_leaf_detection/    # SAM + SegVeg pipeline
│   └── vegetation_indices/       # VARI and TGI computation

Dataset Description

Weekly Data Organization

Each dated folder contains:

  • RGB orthomosaics for both fields (GeoTIFF format)
  • VARI and TGI index rasters
  • RANSAC plane-fitted DEMs (from 2025-09-04 onwards)

Analysis Results:

Date Range Analysis Type Folder
2025-08-13 Plant Counting & Size Estimation plant_counting_&_size_estimation/
2025-08-27, 2025-08-28 Yellow Leaf Detection (SAM + SegVeg) yellow_leaf_detection/
2025-09-17 onwards Panicle Detection (YOLOv5) panicle_counting/

Processing Pipeline

1. Orthomosaic Generation (Agisoft Metashape)

# Flight altitude: 6m
# GSD: ~1.85 mm/pixel
# Frame extraction: Every 6th frame from 4K video @ 24fps
# Overlap: 70-80% forward and lateral

Key Settings:

  • Photo alignment: High accuracy
  • Dense cloud: Mild depth filtering
  • No Ground Control Points (GCPs)
  • No RTK-GPS corrections

2. DEM Generation & Correction

# Flight altitude: 10m
# GSD: ~5.8 mm/pixel
# Flight pattern: Follow-course multi-S-shaped

Artifact Mitigation:

  1. Multi-S-shaped flight pattern reduces doming effects
  2. RANSAC-based plane fitting removes residual linear trends
  3. Automated processing (no manual intervention required)

See code/dem_post_processing/ransac_flatten.py for implementation.

3. Phenotypic Analysis

Early Stage (Week 1-2): Plant counting using RiceNet density regression

  • Input: 1024×1024 pixel tiles with 128px overlap
  • Output: Plant locations and pixel-area estimates
  • Accuracy: 94.95% agreement with manual counts

Mid Stage (Week 3-4): Health monitoring using SAM + SegVeg

  • Stage 1: SAM generates plant masks (isolates from flooded background)
  • Stage 2: SegVeg classifies healthy vs. stressed vegetation
  • Input: 2048×2048 pixel tiles with 256px overlap

Late Stage (Week 5+): Panicle detection using fine-tuned YOLOv5

  • Input: 1024×1024 pixel tiles with 50% overlap
  • Confidence threshold: 0.7, NMS IoU: 0.4
  • Accuracy: 91.59% average detection agreement

Prerequisites

# Python 3.8+
pip install numpy scipy rasterio opencv-python torch torchvision
pip install segment-anything timm pandas matplotlib seaborn

Model Weights & Dependencies

Models Included in This Repository

All model weights provided here were trained by the authors:

Model Task Location Size Notes
YOLOv5 (fine-tuned) Rice panicle detection code/panicle_counting/weights/rice_panicle_yolov5.pt ~90MB Fine-tuned on UAV rice panicle dataset
RiceNet (self-trained) Plant counting code/plant_counting/weights/checkpoint_counting.pt ~80MB Trained on public rice dataset
RiceNet (self-trained) Size estimation code/plant_counting/weights/checkpoint_size_estimation.pt ~62MB Trained on public rice dataset

Architecture Reference: RiceNet architecture from Bai et al., 2023

Models to Download Separately

Due to file size and licensing, please download these models from their official sources:

SAM ViT-B (Segmentation)

# Download from Meta AI (375MB)
wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth
# Place in: code/yellow_leaf_detection/weights/sam_vit_b.pth

Reference: Kirillov et al., 2023

SegVeg (Vegetation Classification)

# Download SegVeg data from https://github.com/mserouar/SegVeg/releases/tag/v1.1.0
# Follow setup instructions in their repository

Reference: Madec et al., 2023

Hardware & Software

UAV Platform

  • Model: DJI Mini 4 Pro
  • Weight: 249g (sub-250g category)
  • Sensor: 1/1.3" CMOS, 48MP
  • Flight time: ~34 minutes per battery

Flight Planning

  • Software: WaypointMap, Litchi
  • Altitude: 6m (orthomosaics), 10m (DEMs)
  • Speed: 1 m/s

Processing Software

  • Photogrammetry: Agisoft Metashape 1.8.5

Authors & Contact

Muhammad Hussain Habib Chaudhry (Corresponding Author)
Department of Computer Science, LUMS
Email: 27100016@lums.edu.pk

Muhammad Ibrahim Rana
Center for Water Informatics & Technology, LUMS
Email: m_rana@lums.edu.pk

Hassan Jaleel
Center for Water Informatics & Technology, LUMS
Department of Electrical Engineering, LUMS
Email: hassan.jaleel@lums.edu.pk

Institution: Lahore University of Management Sciences (LUMS), Pakistan
Website: https://wit.lums.edu.pk


About

Low-cost UAV-based crop phenotyping using RGB imagery without GCPs or RTK-GPS. Includes dual-altitude flight strategy, RANSAC-based DEM correction, and pretrained models for plant counting, height estimation, and panicle detection across rice growth stages.

Topics

Resources

License

Stars

Watchers

Forks

Languages