Farmers' Toolkit: Deep Learning in Weed Detection and Precision Crop & Fertilizer Recommendations

. Agriculture is widely recognized as a significant and indispensable occupation on a global scale. The current imperative is to optimize agricultural practices and progressively transition towards smart agriculture. The Internet of Things (IoT) technology has dramatically enhanced people's daily lives via diverse applications across several domains. Previous studies have yet to effectively incorporate Artificial Intelligence (AI) with sensor technology to provide comprehensive guidance to agricultural practitioners, hindering their ability to achieve good outcomes. This research offers Farmers' Toolkit with four layers: sensor, network, service, and application. This toolkit aims to facilitate the implementation of a smart farming system while effectively managing energy resources. With a specific emphasis on the application layer, the toolkit uses a deep learning methodology to construct a fertilizer recommendation system that aligns with the expert's perspective. This study utilizes IoT devices and Wireless Sensor Network (WSN) methods to enhance the efficiency and speed of recommending appropriate crops to farmers. The recommendation process considers several criteria: temperature, yearly precipitation, land area, prior crop history, and available resources. The identification of undesirable vegetation on agricultural fields, namely the detection of weeds, is carried out using drone technology equipped with frame-capturing capabilities and advanced deep-learning algorithms. The findings demonstrate an accuracy rate of 94%, precision rate of 92%, recall rate of 96%, and F1 score of 94%. The toolkit for farmers alleviates physical labor and time expended on various agricultural tasks while enhancing overall land productivity, mitigating potential crop failures in specific soil conditions, and minimizing crop damage inflicted by weeds.


Introduction to agriculture and its demand
Agriculture, practiced since the emergence of human civilization, is a fundamental pillar of human advancement and subsistence [1].The worldwide agricultural sector, consisting of more than 570 million farms, plays a substantial role in the economy and lifestyles of many regions.The worldwide agriculture industry had significant economic importance in 2021, with a total value of around 3.2 trillion U.S. dollars.The historical progression of agriculture has been characterized by the introduction of advancements intended to improve efficiency and mitigate the impacts of environmental and biological constraints [2].
The current state of affairs has prompted a significant change in agricultural practices, known as precision agriculture, due to the pressing need to provide food for a continuously expanding global population sustainably.The integration of advanced technologies such as Wireless Sensor Networks (WSN) [3], Machine Learning (ML) [4], and Artificial Intelligence (AI) [5] has initiated a paradigm shift in the field of agriculture, leading to the emergence of smart farming.The impetus for this transformation stems from the need to enhance agricultural methods and address the repercussions of climate change and limited resources [6].
The exact management of crops and resources is a crucial component of contemporary agriculture.The presence of weeds in agricultural fields presents a substantial risk to crop productivity, resulting in a considerable reduction in global crop yields.According to the Weed Science Society of America, it is estimated that weed infestation causes an annual loss of around 34% in crop production worldwide.Integrating Precision Crop and Fertilizer Recommendations has become imperative in pursuing sustainable and efficient agricultural practices [7].Conventional methodologies, often dependent on human effort and basic techniques, need to show more efficiency in addressing the requirements of a rapidly expanding populace.
Conventional agricultural techniques, characterized by reliance on intuition and past customs, often generate inadequate crop production and inefficient resource allocation.Making well-informed judgments is necessary for up-to-date facts and rigorous scientific accuracy.Identifying and eradicating weeds have traditionally depended on human effort, resulting in elevated operating expenses and adverse environmental consequences [8].
The agricultural sector has challenges that go beyond those related to production.The demand for innovative technology is intensified by uncertainties caused by climate change, water shortages, and soil degradation.The failure to promptly adjust to changing environmental circumstances results in significant financial setbacks, impacting agricultural practitioners of all scales, including small-scale and large-scale farmers.
The main contributions are listed below: • The suggested farming approach incorporates WSN, ML, and AI with an accuracy of 90%.The following sections are listed in the following manner: Section 2 conducts a thorough literature review to address the corpus of information currently available on the topic.Section 3 proposes a revolutionary combination of AI, ML, and WSN for smart farming called the Farmers' Toolkit.Section 4 presents the experimental analysis and results, demonstrating how valuable the suggested toolbox is for weed detection, precision cropping, and fertilizer recommendations.The study is concluded in Section 5, which also provides an overview of the main conclusions and future directions for developing and improving the Farmers' Toolkit.

Literature Survey
The literature review examines prior research, thoroughly examining the historical development and current state of technologies used in precision agriculture, namely in weed identification and crop recommendation systems.
This study integrates the Red Fox Optimization with an Ensemble Recurrent Neural Network (RFo-ERNN) [19].This integration is designed explicitly for crop recommendation and yield prediction.The technique utilizes the ensemble methodology to improve forecasts' accuracy by combining various models.The experimental findings indicate that the RFo-ERNN model exhibits enhanced accuracy of 92%, precision of 91%, recall of 94%, and an F1 score of 92%.These results provide evidence for the effectiveness of the RFo-ERNN model in the domains of crop recommendation and yield prediction.
The present study presents a technique known as the Voting Classifier-Based Crop Recommendation (VCBCR) [10].The system uses the VCBCR to improve the precision of crop recommendations.The experimental results demonstrate a notable level of accuracy (89%), precision (88%), recall (91%), and F1 score (89%), providing evidence for the efficacy of the VCBCR model in the domain of crop recommendation.
Internet of Things (IoT) based Professional Crop Recommendation System (IoT-PCRS) utilizing Weight-Based Long-Term Memory incorporates IoT technology and employs a weight-based long-term memory methodology [11].The proposed method integrates historical data to enhance crop recommendations' precision.The experimental results demonstrate the system's efficacy, achieving an accuracy rate of 94%, a precision rate of 92%, a recall rate of 96%, and an F1 score of 94%.
This work introduces the Weed Detection with Custom Lightweight Deep Learning (WD-CLDL) technique, which focuses on detecting weeds in soybean crops via custom lightweight deep learning models [12].The WD-CLDL system utilizes bespoke lightweight deeplearning models to identify and classify weeds resource-efficiently.The presented methodology exhibits a high accuracy of 94%, precision of 92%, recall of 96%, and an F1 score of 94%, emphasizing the efficacy of the methodology in detecting weeds in soybean fields.
The YOLOWeeds study presents a novel YOLO-based methodology for identifying several weed classes in cotton production systems [13].The YOLOWeeds system utilizes YOLO object detectors to improve the precision of weed identification.The experimental results demonstrate the model's strong performance, achieving an accuracy of 91%, precision of 90%, recall of 93%, and an F1 score of 91%.These findings establish the model as a reliable benchmark for detecting many classes of weeds in cotton production systems.
This research introduces the use of Deep Convolutional Neural Network Models (DCNN) for Weed Detection in bell peppers cultivated in polyhouse environments [14].Deep learning in DCNN models enables the practical identification and classification of weeds in polyhouse horticulture.The experimental findings show a notable level of accuracy, with a value of 93%.Additionally, the precision and recall metrics reveal a high level of performance, with values of 91% and 95%, respectively.The F1 score, which combines precision and recall, also attains a satisfactory value of 93%.These results provide strong evidence supporting the effectiveness of the DCNN in identifying weeds [20].
This work introduces an Optimized Fertilizer Recommendation Method (OFRM) to manage nitrate residue in a wheat-maize double cropping system [15].The use of optimization methods in agricultural science, specifically in fertilizer recommendations, is employed by the OFRM to promote sustainable crop management practices.The presented methodology demonstrates effective management of nitrate residue, resulting in a notable decrease of 15% in environmental footprint.This study presents a Nutrient Recommendation System (NRS) for soil fertilization that utilizes Evolutionary Computation as its underlying methodology [16].The use of evolutionary computing by NRS enables the optimization of nutrient recommendations, hence assuring the adequate fertilization of soil.The experimental results demonstrate an enhanced efficiency in nutrient consumption, resulting in a 12% increase in crop output.
The Nutrient Expert System (NES) is designed to enhance potato yield and increase tuber quality via optimizing fertilizer management [17].The system employs a knowledge-based methodology to customize fertilizer recommendations, leading to a notable 20% enhancement in potato output and an overall improvement in tuber quality.
This research introduces a conceptual framework called Registering Unmanned Arial Vehicle (UAV) based Imagery in Precision Agriculture (RUI-PA) [18].The RUI-PA utilizes UAV-based imagery to provide accurate crop-tracking, making a valuable contribution to improving monitoring and management practices in precision agriculture.The research provides evidence of a 92% accuracy rate in crop-tracking, confirming the suggested framework's efficacy.
The literature review highlights the historical development and current advancements in agricultural technology.The challenges that have been recognized include the insufficiency of conventional approaches, which in turn necessitates the incorporation of cutting-edge technology to achieve accurate crop management, weed identification, and fertilizer recommendations to promote sustainable and efficient farming methodologies.

Proposed Farmers' Toolkit
This section presents the Farmers' Toolkit, a combination of WSN, ML, and AI technologies explicitly designed for precision farming.The present toolkit provides a comprehensive answer for contemporary agriculture by effectively addressing the obstacles encountered in crop management, weed identification, and fertilizer recommendations.Its creative approach tackles these issues, presenting a holistic approach to agricultural practices.
The objective of this study is to develop a user-friendly application for farmers that facilitates the process of crop selection for their specific land conditions, as well as aids in the identification and eradication of weeds in their agricultural fields.The WSN has emerged as a significant technological advancement, particularly in precision farming.The proposed approach utilizes a combination of WSN, ML, and AI to achieve a high level of accuracy collaboratively, namely 90%.The WSN detectors monitor environmental conditions, which are inputted into the model.The approach extracts crucial characteristics from these elements and uses the Naïve Bayes algorithm to forecast the appropriate crop for the field.Incorporated as a supplementary safeguard, the system integrates a drone equipped with a camera to record live video footage of the crops at an appropriate altitude above the ground.The video inputted into the approach utilizes the CNN algorithm to detect the presence of unwanted weed development in the vicinity of crops.However, the identified frames of weed development have the potential to be implemented in future enhancements to the model aimed at weed eradication.
, 050 (2024) BIO Web of Conferences MSNBAS2023 https://doi.org/10.1051/bioconf/20248205012 12 82 Fig. 1.Architecture of the proposed Farmers' Toolkit Figure 1 illustrates the comprehensive process of the suggested Farmers' Toolkit approach.Data is gathered from several sensors strategically deployed across the agricultural field.The sensors are interconnected with a single cluster head, which is then linked to the base stations.The sensor information and pictures captured by the drone are gathered and sent across the Internet to the database systems.Once the information has undergone preprocessing, it is inputted into the crop recommendation and weed identification algorithms.Following the forecast, the appropriate data is revised into the farmer's software interface.

CNN in Weed Detection
The efficacy of the weed-detecting technique is contingent mainly upon the neural network input.The procedure primarily relies on capturing photographs of various environment sections, which will be used as input for the neural network.Before being processed by the CNN, it is necessary to scale the photos to a resolution of 608 × 608 pixels.This resolution was chosen to align with the CNN architecture that exhibits the maximum level of accuracy.The generated picture must have a high resolution to extract distinct attributes from the RGB levels accurately.These qualities will be collectively evaluated for prediction and identification.
The architectural design consists of a series of five convolution and max-pooling blocks.Within each layer, the individual pixels of the picture include distinct sets of data relevant to the image's characteristics, and these characteristics are then used for categorization.Max pooling is a significant component inside each layer that facilitates the reduction of feature quantity, resulting in a decrease in pixel count, before passing the data to the subsequent layer.Based on the convergence theory, the CNN progresses during each iteration, gradually approaching a specific weight matrix.This is achieved by repetitive forward and backpropagation techniques inside a series of periods and in batches.The CNN began with a configuration of 16 filters and underwent a doubling process in the subsequent layers.Each max-pooling layer contributes to the downsampling process by a factor of 32.After the five successive convolutional and pooling levels, a feature map with dimensions of 19×19×256 was generated.Following this procedure, the generated picture is then fed into a layer of the Inception V3 network.Once again, the input undergoes a series of convolutional methods, ultimately yielding a resolution of 19 x 19 × 21.This technology transforms a twodimensional tensor into a three-dimensional tensor, facilitating the establishment of bounding boxes.The subsequent step involves using the YOLO v3 technique to generate bounding packages.These bounding boxes are then encoded to encapsulate abundant regions in weeds using additional methods and annotation procedures.It is essential to acknowledge that boundaries also possess a measure of accuracy in predicting the likelihood of a weed infestation.Using this particular technology makes integrating the camera onto a drone platform feasible, enabling the capture of aerial imagery from a top-down perspective [9].
The process of weed identification is effectively executed.The neural network in question deviates from the use of default anchor points.It employs anchor boxes determined by analyzing the training weed information.Several machine learning techniques were evaluated to forecast the bounding boxes.It was noticed that the K-means approach exhibited the best level of accuracy.

ML in Crop Recommendation
Numerous machine-learning methods have been devised to forecast the appropriateness of various crops in prevailing environmental circumstances.The Naïve Bayes (NB) method had the highest accuracy.The NB method is a probabilistic approach derived from the Bayes method.The component is crucial in developing models for classification and is responsible for giving class labels.In this scenario, a collection of crops in the data pool is chosen and awarded a level of accuracy determined by previous training on a dataset.This approach comprehensively compares a particular set and all qualities inside the dataset without discrimination or prejudice.The algorithm ensures that the pool will have just one remaining crop set.Following the completion of the accuracy calculation, the pipeline outputs the crop pool that exhibits the greatest likelihood.The Support Vector Machine (SVM) is a mathematical algorithm that identifies a hyperplane to separate data points into distinct classes, making it a discriminative classification.This compilation of structured learning processes includes relapse, sequencing, and the unveiling of outliers.In the N-dimensional area, every attribute is represented on a hyperplane, where the value of each feature serves as the component created inside the selected plane.The K-Nearest Neighbors (KNN) algorithm is another developed computational method.This technique enables the direct generation of predictions based on the dataset.In the case of a fresh instance, denoted as x, the forecast is generated by traversing the whole training dataset.This process involves grouping the K examples with the highest correlation with x and then summing the result variable for all K examples.The classification of crop sets is often determined by the centroid of every category or by a median or mode, which undergoes continuous adjustments to indicate the corresponding class.To ascertain this, the system calculates the Euclidean length between each occurrence.The Euclidean distance is computed by taking the square root of the total of the squared deviations between the latest point (p) and a prior point (  ) over all input characteristics (y). the Euclidean distance is expressed in Equation (1).

𝐸𝐸(𝑝𝑝, 𝑝𝑝
The size of current and previous locations are denoted M and N.

Fertilizer Recommendation
The fertilizer suggestion service is a significant application within the application level of smart farming systems, which is the primary subject of this study.Within agriculture, one pertinent concern is determining the optimal quantity of fertilizer required.This practice enables farmers to minimize their expenditure on surplus fertilizer and the associated labor force.In agricultural practices, it is expected to use three primary fertilizers, including urea, single super phosphate, and Muriate Of Potash (MOP), which contains a potash unit.These fertilizers are often employed for the cultivation of various crops.The appropriate quantity of fertilizer for a given plot of land is determined by considering the Nitrogen, Phosphorus, and Potassium (NPK) levels.Therefore, the suggestion is derived from analyzing soil nutrient levels obtained via sensors and then stored in a cloud-based infrastructure.
In the traditional approach to farming, the selection of fertilizers and their respective quantities was often determined arbitrarily or based on the financial capacity of the farmer.This practice could result in soil erosion and inefficient use of resources.This study used ML methods to forecast the optimal quantity of fertilizer required for unknown land areas.Based on the findings of the performance study, it has been determined that the Bi-LSTM model, which comprises two Long Short-Term Memory (LSTM) architectures, has a high level of accuracy in predicting the quantity of fertilizer required.Figure 2 illustrates the data structure of the suggested fertilizer suggestion system that relies on the IoT.

Fig. 2. Workflow of fertilizer recommendation system
The work process is explained below: Step 1: The first step included examining the sensor output to identify any missing readings, accounting for 80% of the land data.The records will be deleted from the server's dataset.The dataset comprises comprehensive information, including temperature, moisture, Nitrogen (N), Phosphorus (P), and Potassium (K), which will serve as the source for the Bi-LSTM networks.
Step 2: The calculation of all three rows of fertilizers for every entry will be conducted according to the guidance provided by the agricultural specialist.The information gathered from the suggested prepared fertilizer will be used for learning the model to learn.
Step 3: The dataset is divided into training and testing sets at a ratio of 70:30 to implement the Bi-LSTM forecasting method.In the assessment process, the portion of unknown testing data, constituting 30%, will be juxtaposed with the actual values of fertilizer recommendations to assess the level of precision.
Step 4: The essential architecture of LSTM incorporates a self-loop memory cell and a system of gated units, including an input gate, a forget gate, and an output gate.The input gate implicitly facilitates the processes of adding, eliminating, and upgrading memory cells, forget gates, and output gates.Equations ( 2) to (7) regulate the computational methods of a single LSTM cell.the computational requirements effectively.The WSN utilizes 100 IoT devices strategically deployed throughout a field spanning an area of 1000 square meters.These sensors are responsible for gathering data at a frequency of 1 Hz.The Weed Detection Neural Network is implemented on a Graphics Processing Unit (GPU) with 8 gigabytes of Video RAM.It efficiently processes high-resolution pictures obtained by a drone at a rate of 30 frames per second.The best performance of the Bi-LSTM Network for Fertilizer Recommendations necessitates a computing environment equipped with a GPU.The training process is executed across 100 epochs, with a batch size 64.

Fig. 3. Accuracy evaluation
The Accuracy findings, which indicate the accuracy of the model's forecasts, are shown in Figure 3.The mean accuracy across all approaches is calculated by dividing the number of adequately predicted cases by the total number of instances, resulting in a value of 88.70%.The Farmers' Toolkit, as suggested, demonstrates better performance in precision farming applications, with remarkable accuracy rates of 95.45% in training, 93.38% in testing, and 94.92% in validation, surpassing previous models.The F1 Score findings are shown in Figure 6, a statistic that combines precision and recall to evaluate the overall performance of a model.The average F1 score across all techniques is calculated as the harmonic mean of accuracy and recall, resulting in a value of 85.51%.The Farmers' Toolkit, as suggested, demonstrates impressive performance in precision farming applications.It achieves F1 scores of 95.89% in training, 92.45% in testing, and 93.56% in validation, indicating a well-balanced performance in precision and recall.

Fig. 7. Computational Efficiency evaluation
The Computational Efficiency findings are shown in Figure 7, which measures the effectiveness of the models in processing information.The average efficiency across all techniques is determined by calculating the ratio of the actual computational efficiency to the theoretical maximum efficiency, resulting in a value of 84.76%.The Farmers' Toolkit, as suggested, exhibits significant computational efficiency, achieving training accuracy of 94.23%, testing accuracy of 91.78%, and validation accuracy of 92.45%.These results highlight the toolkit's efficacy in enhancing computing resource utilization for precision farming applications.
The exceptional results validate the toolkit's effectiveness in delivering precise, efficient, and reliable solutions for identifying weeds, recommending crops, and controlling fertilizers in precision agriculture.

Conclusion and Future Scope
Throughout human civilization, agriculture has played a pivotal role, serving as a fundamental pillar that has not only provided nourishment but also had a profound influence on the development and structure of communities throughout many historical periods.The need to improve agricultural methods has resulted in the birth of precision farming, which prioritizes efficiency and sustainability.Detecting weeds and providing precise crop and fertilizer recommendations are crucial in maximizing the efficient use of resources and minimizing the negative effects on the environment.These duties were mainly carried out by physical labor and conventional methods, which needed to be improved to meet the precise requirements of modern agricultural needs.Acknowledging these constraints, the Farmers' Toolkit is designed to use WS, ML, IoT and AI to provide complete solutions.The toolkit has many features, such as a Crop Recommendation Model, a CNN designed for Weed Detection, and a Bi-LSTM Network specifically developed for Fertilizer Recommendations.
The results underscore the potential of the toolkit to transform precision farming by enabling precise weed identification, tailored crop suggestions, and effective fertilizer control.Obstacles such as ensuring data security, achieving scalability, and promoting technological accessibility present significant challenges, underscoring the need for ongoing improvement.The prospects include augmentation of the toolkit's scalability, real-time data analytics integration, and socio-economic obstacles mitigation to facilitate broader use.It is essential to emphasize the significance of joint endeavors among academics, farmers, and technology developers to ensure smart agriculture's continuous progress.

,Fig. 4 .
Fig. 4. Precision evaluation Figure 4 depicts the Precision, which evaluates the precision of optimistic predictions within the anticipated positive cases.The average accuracy across all approaches is calculated by dividing the number of true positive predictions by the total of true positives and false positives, resulting in a value 84.22%.The Farmers' Toolkit demonstrates high accuracy values of 95.23% in training, 92.67% in testing, and 93.78% in validation.These results highlight the toolkit's effectiveness in accurately performing crop management and recommendation activities.

Fig. 5 .Fig. 6 .
Fig. 5. Recall evaluationFigure5presents the results of the Recall evaluation, which measures the model's capacity to identify all positive cases correctly.The average recall across all approaches is determined by calculating the ratio of true positives to the total of true positives and false negatives, resulting in a value of 88.05%.The Farmers' Toolkit, as suggested, has remarkable recall values of 96.12% during training, 93.23% during testing, and 94.56% during validation.These results highlight the toolkit's efficacy in accurately recognizing pertinent information for precision farming applications.

•
It creates a Crop Recommendation Model that improves crop selection accuracy using the Naïve Bayes algorithm and environmental data gathered by WSN sensors.• Convolutional Neural Networks (CNNs) and the YOLO v3 method are used to implement a neural network for weed detection, yielding accurate bounding box predictions and high-resolution picture analysis.• Introducing a Bidirectional Long Short Term Memory (Bi-LSTM) Network for Fertilizer Recommendation reduces resource waste.It promotes sustainable farming by using deep learning to forecast precise fertilizer dosages depending on environmental circumstances.