WheatNet: A Lightweight Convolutional Neural Network for High-throughput Image-based Wheat Head Detection and Counting

Saeed Khaki, Nima Safaei, Hieu Pham, Lizhi Wang · DOI

Abstract

For a globally recognized planting breeding organization, manually-recorded field observation data is crucial for plant breeding decision making. However, certain phenotypic traits such as plant color, height, kernel counts, etc. can only be collected during a specific time-window of a crop's growth cycle. Due to labor-intensive requirements, only a small subset of possible field observations are recorded each season. To help mitigate this data collection bottleneck in wheat breeding, we propose a novel deep learning framework to accurately and efficiently count wheat heads to aid in the gathering of real-time data for decision making. We call our model WheatNet and show that our approach is robust and accurate for a wide range of environmental conditions of the wheat field. WheatNet uses a truncated MobileNetV2 as a lightweight backbone feature extractor which merges feature maps with different scales to counter image scale variations. Then, extracted multi-scale features go to two parallel sub-networks for simultaneous density-based counting and localization tasks. Our proposed method achieves an MAE and RMSE of 3.85 and 5.19 in our wheat head counting task, respectively, while having significantly fewer parameters when compared to other state-of-the-art methods. Our experiments and comparisons with other state-of-the-art methods demonstrate the superiority and effectiveness of our proposed method.

Introduction

In the field of plant breeding, "phenotyping" — the systematic measurement of physical traits — remains a critical bottleneck. Traits such as wheat head count are essential for estimating yield and making informed breeding decisions. However, manual counting is labor-intensive, time-sensitive, and prone to human error, typically estimated at around 10%.

Automating this process via computer vision is fraught with challenges. Wheat fields are complex, chaotic environments where images vary significantly due to lighting conditions, growth stages, and varying genotypes that affect color and shape. Furthermore, the distance between the camera and the crop can vary, leading to scale inconsistencies.

Dense wheat field image illustrating the complexity of head counting.

Existing high-performance AI models often require substantial computational resources, making them unsuitable for real-time deployment on mobile devices or drones in remote field locations. There is a clear need for a lightweight yet accurate solution.

Methodology

The proposed WheatNet architecture is designed to balance computational efficiency with high precision. It consists of three primary components:

1. Truncated MobileNetV2 Backbone

WheatNet utilizes MobileNetV2, a model optimized for mobile platforms, as its feature extractor. A key innovation in this work is the "truncation" of the backbone. By retaining only the first four bottleneck blocks and removing the deeper layers, the authors achieved higher accuracy and reduced latency. This suggests that for agricultural counting tasks, the high-level abstractions of very deep networks may discard essential spatial details.

2. Multi-Scale Feature Fusion

To address variations in wheat head size caused by camera distance, WheatNet merges feature maps from multiple layers. This fusion allows the network to capture both fine-grained details and broader contextual information simultaneously.

3. Dual-Branch Output

The architecture employs two parallel sub-networks:

  • Counting Branch: Utilizes dilated convolutions to generate a density map. The total count is derived by integrating this map.
  • Localization Branch: Predicts the precise center points of individual wheat heads.

The model is trained using a hybrid loss function: Euclidean loss for density estimation and Focal loss for localization. Focal loss is particularly effective here, as it forces the model to focus on challenging wheat head features while ignoring the vast, repetitive background of leaves.

Dataset and Training

The study leverages the Global Wheat Head Detection (GWHD) dataset, which includes 3,373 high-resolution RGB images from 10 different global locations. This diversity ensures the model is robust against various environmental factors.

The GWHD dataset showcases a wide variety of growth stages, lighting conditions, and genotypes.

A significant contribution of this research is the advocacy for point-level annotation. By marking only the center of each head rather than drawing bounding boxes, the labeling process is significantly accelerated, facilitating the creation of larger, more diverse datasets.

Results and Discussion

WheatNet demonstrates superior performance compared to several larger state-of-the-art (SOTA) models:

  • Accuracy: It achieved a Mean Absolute Error (MAE) of 3.85 and a Root Mean Squared Error (RMSE) of 5.19, outperforming models like Faster R-CNN (MAE 4.25) and CSRNet (MAE 6.61).
  • Efficiency: With only 4.04 million parameters, WheatNet is over ten times smaller than models like ASD (50.86M) or Faster R-CNN (43.17M).
  • Speed: The model achieves an inference time of 0.54 seconds on a standard CPU, making it viable for edge deployment.
  • Reliability: The overall prediction error of approximately 0.087% is a substantial improvement over the 10% error rate typical of manual human observations.

The synergy between the counting and localization branches is a key insight; joint training allows the model to learn more discriminative features, with the localization branch effectively "sharpening" the density maps.

Conclusion

WheatNet provides a highly efficient and accurate solution for automated wheat head counting. Its lightweight architecture makes it ideal for integration into mobile applications, allowing breeders and farmers to obtain instant, reliable yield estimates in the field. Future work will explore adapting this framework to other agricultural counting tasks, such as kernel estimation or fruit detection, further reducing the phenotyping bottleneck in global agriculture.

Summary updated

BibTeX
@misc{khaki2021wheatnet,
  author = {Saeed Khaki and Nima Safaei and Hieu Pham and Lizhi Wang},
  title = {{WheatNet: A Lightweight Convolutional Neural Network for High-throughput Image-based Wheat Head Detection and Counting}},
  year = {2021},
  eprint = {2103.09408},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.09408},
}
Figure