A Deep Learning Framework for Smart Agriculture: Real-
Time Weed Classification Using Convolutional Neural
Network
Sushilkumar S. Salve,
*
Sourav S. Chakraborty, Sanskar Gandhewar and Shrutika S. Girhe
Department of Electronics and Telecommunication, Sinhgad Institute of Technology, Lonavala, Maharashtra, 410401, India
*Email: sushil.472@gmail.com (S. S. Salve)
Abstract
Agricultural sector being the foundation of food supply and raw material production contributes significantly to the
GDP growth and value chain. Thus, the effective elimination of weed in modern day agriculture is essential as the
current world scenario demands for efficient and resourceful ways for crop cultivation and harvesting. The urgent
need for elimination of weeds arises due to their tendency to extricate all the essential minerals and moisture that
the crops require for their appropriate growth. The main objective of this study is to successfully acquire live video
feed as input, classification into categories of crop, weed and none. Finally, upon detection of weed the spraying
mechanism releases a pre-determined amount of herbicide upon the weed. A total of 5471 image samples were
captured to train the CNN model. The prototype mentioned in this paper uses Convolutional Neural Network (CNN)
technique for feature extraction, Fully Connected Layers or Dense Layers (FCLs) for classification using SoftMax as the
activation function respectively. The activation function also here is being used to remove all negative (less significant)
values. Also, a comprehensive comparison was made between the CNN and YOLOv4 technique and performance
parameters of both were evaluated. The CNN technique achieved an accuracy of 95.50% whereas YOLOv4 achieved
91.00%. Finally, the F1 Score was evaluated to be 96.25% and 91.96% respectively. Compared to existing models, our
prototype demonstrated higher accuracy and real-time adaptability in field conditions, proving suitable for
autonomous weed management systems. Unlike earlier systems that depended mostly on stored images or fixed
datasets, our approach stands out by using a live video feed to identify weeds in real-time. It’s built on a mobile
platform that can automatically spray herbicides, making precision farming possible without the need for constant
human supervision.
Keywords: Computer vision; Convolutional Neural Network; Deep learning; SoftMax; Max pooling; Weed detection; Image
pre-Processing.
1. Introduction
In crop fields, weeds are naturally occurring plants that compete with crops for vital resources like space, light,
moisture, and air, which may lower crop yield. Effective weed control is essential during cultivation because they
impede crop growth.
[1]
Farmers may experience lower yields and financial losses as a result of weeds competing for
resources with cash crops. The impact of weeds varies depending on the crop type and the farm’s geographical
location.
[2]
Weeds can reduce yield by up to 34% if they are not controlled, whereas animal pests and diseases cause
yield loss of 18% and 16%, respectively. Weed infestations can result in crop losses of roughly 23% to 44% in typical
crop fields.
[1]
Simultaneously, the agricultural sector is under pressure to achieve steadily rising yields as the demand
for more food production rises at the same time.
[3]
This emphasizes how precision farming and robotics are necessary
to increase yield while lowering dependency on conventional farming practices. Modern technology has made it
possible for autonomous machines to carry out agricultural tasks effectively. High-quality crops can be produced with
little human labor when robotics and intelligent machinery are integrated into agriculture.
[3,4]
A weed detection system uses machine learning algorithms to identify unwanted plants in an agricultural field. Farmers
can reduce their use of weed and herbicides, which can be harmful to the environment and public health. Plans for
targeted weed control can be created by utilizing the information on the types of the weeds that the detecting system
can supply.
[5]
A new technology that has the potential to completely transform agriculture is machine learning-based
weed detection. The system's purpose is to locate and identify weeds in a field so that farmers can take specific action
to get rid of them, gather live videos and photos of a field, apply machine learning techniques to the same, and then
determine the weeds. Numerous methods, such as object detection, feature extraction, segmentation, and
Classification, can be used to complete this process. We decided to use a live feed CNN technique to address this
problem it's more like analyzing the input dataset to find the weeds.
[5,6]
The weeds within rows might not be accurately removed by conventional machinery. Sunil G C et al. emphasized
while introducing their study on the thought that the herbicide which is sprayed uniformly across the field, treating
weeds and crops alike, at a set pace when compared to site-specific herbicide applications prove less feasible as blanket
herbicide applications may have a more negative impact on the ecosystem. As a result, applying an herbicide