Alfalfa detection and stem count from proximal images using a combination of deep neural networks and machine learning

• The combination of semantic segmentation and machine learning models can effectively quantify alfalfa stems in an image. • Deep semantic segmentation models can be efficiently trained by combining synthetic and real images. • Synthetic images improve model generalization and significantly reduce the time spent on manual image annotation. • A simple deep U-Net model demonstrated superior performance in classifying alfalfa pixels compared to advanced ones. Among various types of forages, Alfalfa (Medicago sativa) is a crucial forage crop that plays a vital role in livestock nutrition and sustainable agriculture. As a result of its ability to adapt to different weather conditions and its high nitrogen fixation capability, this crop produces high-quality forage that contains between 15 and 22 % protein. It is fortunately possible to improve the overall prediction of forage biomass and quality prior to harvest through remote sensing technologies. The recent advent of deep Convolution Neural Networks (deep CNNs) enables researchers to utilize these incredible algorithms. This study aims to build a model to count the number of alfalfa stems from proximal images. To this end, we first utilized a deep CNN encoder-decoder to segment alfalfa and other background objects in a field, such as soil and grass. Subsequently, we employed the alfalfa cover fractions derived from the proximal images to develop and train machine learning regression models for estimating the stem count in the images. This study uses many proximal images taken from significant number of fields in four provinces of Canada over three consecutive years. A combination of real and synthetic images has been utilized to feed the deep neural network encoder-decoder. This study gathered roughly 3447 alfalfa images, 5332 grass images, and 9241 background images for training the encoder-decoder model. With data augmentation, we prepared about 60,000 annotated images of alfalfa fields containing alfalfa, grass, and background utilizing a pre-trained model in less than an hour. Several convolutional neural network encoder-decoder models have also been utilized in this study. Simple U-Net, Attention U-Net (Att U-Net), and ResU-Net with attention gates have been trained to detect alfalfa and differentiate it from other objects. The best Intersections over Union (IoU) for simple U-Net classes were 0.98, 0.93, and 0.80 for background, alfalfa and grass, respectively. Simple U-Net with synthetic data provides a promising result over unseen real images and requires an RGB iPad image for field-specific alfalfa detection. It was also observed that simple U-Net has slightly better accuracy than attention U-Net and attention ResU-Net. Finally, we built regression models between the alfalfa cover fraction in the original images taken by iPad, and the mean alfalfa stems per square foot. Random forest (RF), Support Vector Regression (SVR), and Extreme Gradient Boosting (XGB) methods have been utilized to estimate the number of stems in the images. RF was the best model for estimating the number of alfalfa stems relative to other machine learning algorithms, with a coefficient of determination (R 2 ) of 0.82, root-mean-square error of 13.00, and mean absolute error of 10.07.

Authors

Institutions

Publication Details

Journal
Computers and Electronics in Agriculture
Published
2025-02-15
DOI
https://doi.org/10.1016/j.compag.2025.110115
Citations
6
Primary Topic
Remote Sensing and LiDAR Applications
Type
article
Field-Weighted Citation Impact
4.79

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Alfalfa detection and stem count from proximal images using a combination of deep neural networks and machine learning

Viacheslav I. Adamchuk, Hazhir Bahrami, Karem Chokmani, Saeid Homayouni et al.
6 citations
Computers and Electronics in Agriculture
Remote Sensing and LiDAR Applications
4.79
article

Alfalfa detection and stem count from proximal images using a combination of deep neural networks and machine learning

Viacheslav I. Adamchuk, Hazhir Bahrami, Karem Chokmani, Saeid Homayouni, Maxime Leduc, Md Saifuzzaman
article en
6 citations

Abstract

• The combination of semantic segmentation and machine learning models can effectively quantify alfalfa stems in an image. • Deep semantic segmentation models can be efficiently trained by combining synthetic and real images. • Synthetic images improve model generalization and significantly reduce the time spent on manual image annotation. • A simple deep U-Net model demonstrated superior performance in classifying alfalfa pixels compared to advanced ones. Among various types of forages, Alfalfa (Medicago sativa) is a crucial forage crop that plays a vital role in livestock nutrition and sustainable agriculture. As a result of its ability to adapt to different weather conditions and its high nitrogen fixation capability, this crop produces high-quality forage that contains between 15 and 22 % protein. It is fortunately possible to improve the overall prediction of forage biomass and quality prior to harvest through remote sensing technologies. The recent advent of deep Convolution Neural Networks (deep CNNs) enables researchers to utilize these incredible algorithms. This study aims to build a model to count the number of alfalfa stems from proximal images. To this end, we first utilized a deep CNN encoder-decoder to segment alfalfa and other background objects in a field, such as soil and grass. Subsequently, we employed the alfalfa cover fractions derived from the proximal images to develop and train machine learning regression models for estimating the stem count in the images. This study uses many proximal images taken from significant number of fields in four provinces of Canada over three consecutive years. A combination of real and synthetic images has been utilized to feed the deep neural network encoder-decoder. This study gathered roughly 3447 alfalfa images, 5332 grass images, and 9241 background images for training the encoder-decoder model. With data augmentation, we prepared about 60,000 annotated images of alfalfa fields containing alfalfa, grass, and background utilizing a pre-trained model in less than an hour. Several convolutional neural network encoder-decoder models have also been utilized in this study. Simple U-Net, Attention U-Net (Att U-Net), and ResU-Net with attention gates have been trained to detect alfalfa and differentiate it from other objects. The best Intersections over Union (IoU) for simple U-Net classes were 0.98, 0.93, and 0.80 for background, alfalfa and grass, respectively. Simple U-Net with synthetic data provides a promising result over unseen real images and requires an RGB iPad image for field-specific alfalfa detection. It was also observed that simple U-Net has slightly better accuracy than attention U-Net and attention ResU-Net. Finally, we built regression models between the alfalfa cover fraction in the original images taken by iPad, and the mean alfalfa stems per square foot. Random forest (RF), Support Vector Regression (SVR), and Extreme Gradient Boosting (XGB) methods have been utilized to estimate the number of stems in the images. RF was the best model for estimating the number of alfalfa stems relative to other machine learning algorithms, with a coefficient of determination (R 2 ) of 0.82, root-mean-square error of 13.00, and mean absolute error of 10.07.

Computers and Electronics in AgricultureVol. 232
FPInnovations (CA), Institut National de la Recherche Scientifique (CA), McGill University (CA)
Mitacs, Agriculture and Agri-Food Canada, Fonds de recherche du Québec – Nature et technologies
Openalex Percentile: Top 6%
Remote Sensing and LiDAR Applications
4.79
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.