Next Article in Journal
Real-Time Bus Departure Prediction Using Neural Networks for Smart IoT Public Bus Transit
Previous Article in Journal
Industrial IoT-Based Energy Monitoring System: Using Data Processing at Edge
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Integrated Iot Approaches for Crop Recommendation and Yield-Prediction Using Machine-Learning

1
Laboratory LIM, IT Department FST Mohammedia, Hassan II University, Casablanca 20190, Morocco
2
Faculty of Medicine and Pharmacy, Mohammed V University, Rabat 10090, Morocco
*
Author to whom correspondence should be addressed.
IoT 2024, 5(4), 634-649; https://doi.org/10.3390/iot5040028
Submission received: 14 June 2024 / Revised: 17 September 2024 / Accepted: 29 September 2024 / Published: 30 September 2024

Abstract

:
In this study, we present an integrated approach utilizing IoT data and machine learning models to enhance precision agriculture. We collected an extensive IoT secondary dataset from an online data repository, including environmental parameters such as temperature, humidity, and soil nutrient levels, from various sensors deployed in agricultural fields. This dataset, consisting of over 1 million data points, provided comprehensive insights into the environmental conditions affecting crop yield. The data were preprocessed and used to develop predictive models for crop yield and recommendations. Our evaluation shows that the LightGBM, Decision Tree, and Random Forest classifiers achieved high accuracy scores of 98.90%, 98.48%, and 99.31%, respectively. The IoT data collection enabled real-time monitoring and accurate data input, significantly improving the models’ performance. These findings demonstrate the potential of combining IoT and machine learning to optimize resource use and improve crop management in smart farming. Future work will focus on expanding the dataset to include more diverse environmental factors and exploring the integration of advanced deep learning techniques for even more accurate predictions.

1. Introduction

The cultivation of precision crops, often known as agricultural precision or smart farming, is a crop organization method that uses skill to exploit produce crops, then increase resource efficiency [1]. It entails gathering and evaluating information on soil composition, moisture levels, climate arrangements, and crops’ well-being trends as a directive to make educated decisions about planting, fertilizing, watering, and harvesting. Efficient crop recommendation and forecasting of yield systems are essential parts of precision agriculture. These systems, which use analytics, machine learning, and IoT (Internet of Things) technology, can analyze massive quantities of data to offer farmers individualized suggestions [2]. These suggestions may include crop selection based on soil characteristics, the environment, and demand from the marketplace, as well as ideal planting and cultivation procedures.
Using precision farming allows agriculturalists to move toward procedural assets like nutrients, aquatics, and then herbicides more efficiently [3,4]. Farmers may decrease waste and expenses while increasing crop yields by applying these inputs just where and when they are required. A precision farming approach reduces environmental effects by minimizing chemical usage and improving resource allocation. It encourages sustainable farming methods by saving water, improving soil health, and lowering pollutants. Precision agriculture enables farmers to more effectively track and handle their fields by utilizing technology including GPS, sensors, drones, and data processing. This leads to greater outputs since farmers can recognize and handle concerns like pests, illnesses, and nutritional deficits instantaneously.
The sustainability of the environment was another important feature of precision agriculture [5]. Precision agriculture encourages environmentally friendly agricultural techniques by limiting chemical use, preventing soil erosion, and saving water. Farmers may enhance soil health and minimize their use of synthetic fertilizers and pesticides by employing conservation tillage practices and using cover crops. Precision agriculture allows for more exact application of agrochemicals, reducing runoff and polluting of water sources.
The growth in precision farming adoption is driven mostly by increased production. Farmers may use technologies like GPS, sensors, and unmanned aircraft, along with information analytics to monitor their fields with remarkable accuracy and efficiency [6]. Continuous observation enables farmers to quickly identify and solve concerns like insect infestations, illnesses, and nutrient shortages, reducing output losses. Better decision-making is made possible by precise agriculture at every stage of the agricultural cycle, from choosing plants and sowing to arranging irrigation and harvest timing, which eventually results in increased yields and better-quality crops.
Another big benefit of precision farming is risk reduction. Risks faced by farmers include volatile markets, pest and disease outbreaks, and unexpected weather. With the use of current information, precision agriculture reduces these hazards by offering actionable insights and early warnings. For instance, farmers may predict drought situations and modify their irrigation schedules by integrating meteorological forecasts and moisture level data [7]. In a similar vein, crop monitoring systems can identify early warning indicators of illnesses or insect infestations, enabling farmers to take preventative or corrective action.
Precision farming demands accurate predictions of crop yield and efficient resource management, but these tasks are often complicated by various environmental factors such as soil quality, temperature, and humidity. Traditional prediction methods frequently overlook the intricate relationships between these variables, leading to less effective farm management recommendations. This study addresses this issue by leveraging IoT-based data collection combined with machine learning techniques to enhance the precision of crop yield predictions.
The research objectives are closely tied to this problem. The first objective is to design and implement an IoT system that effectively captures environmental data crucial to crop outcomes. The second objective involves applying machine learning models to analyze the collected data and improve the accuracy of yield predictions. The final objective is to validate the proposed approach through comprehensive field testing and comparisons with conventional prediction methods. Each of these objectives is structured to address the challenges identified in the problem statement, ultimately aiming to improve decision-making in precision farming.

2. Literature Review

Conventional farming and traditional agriculture have long been the standard, relying on tried-and-true techniques that have been passed down through the years. But these methods have built-in drawbacks that provide serious difficulties for farmers all around the world [8,9]. The main drawback is the use of antiquated methods and human labor for activities like pest management, irrigation, and planting. In addition to requiring a substantial amount of time and energy, manual labor adds to crop management and output fluctuations.

2.1. Traditional Agriculture Challenges

Traditional agricultural methods frequently suffer from a lack of accuracy and efficiency, which causes inefficiencies and production losses. For instance, applying insecticides and fertilizers uniformly throughout vast fields may lead to either an excessive or insufficient usage of these inputs, which would degrade the ecosystem and result in higher expenses and worse yields [10]. Furthermore, farmers who base their decisions only on experience and practical knowledge are exposed to un-predictabilities including volatile markets, insect outbreaks, and weather variations.
  • Limited Ability to Make Precise Decisions: Conventional agricultural practices frequently depend more on broad strategies than on accurate, data-driven decision-making. Farmers may evenly administer irrigation, herbicides, and fertilizers throughout whole fields, which might have a negative impact on the environment and result in inefficient use of resources.
  • Environment and Climate: The weather and climate, which can be erratic and turbulent, play a major role in conventional agriculture [11]. Droughts, floods, or extremely high temperatures are examples of unfavorable weather phenomena that can cause crop failures, production losses, and financial instability for farmers.
  • Difficulties with Disease Management: Traditional methods of controlling pests and diseases may mostly rely on chemical inputs, which can pollute the environment and disturb ecosystems. Over time, pests and illnesses may become resistant to pesticides and herbicides, requiring greater chemical use and raising production costs.
  • Labor Lack: Manual work is needed for labor-intensive chores including planting, harvesting, and weed management in traditional agricultural methods. There is a growing labor shortage in agriculture due to the aging of the agricultural workforce, and the movement towards urbanization is supported by various sources. The labor shortage in agriculture is a significant issue, exacerbated by the aging agricultural workforce and the trend of younger generations moving to urban areas for better opportunities. One source discusses how the American Farm Bureau Federation highlights the annual need to fill over 2.4 million farm jobs, with a drastic decline in available workers each year.
These inefficiencies and productivity losses in traditional agriculture are caused by a number of variables. Farmer decision-making is hampered by limited access to timely and reliable information on market needs, weather, and soil health [12]. Moreover, all of these challenges are made worse by a lack of funds and infrastructure, particularly in rural regions, which makes it challenging for farmers to implement optimal methods and contemporary technology [13].
Long-term sustainability is frequently neglected in favor of optimizing short-term returns in traditional agricultural methods. Ecosystem degradation is exacerbated by practices that limit biodiversity, deteriorate soil health, and rely too much on chemical inputs, such as monoculture and excessive tilling. Over time, these unsustainable methods endanger human health and food security in addition to weakening used for farming systems’ adaptability.

2.2. Role of IoT in Agriculture

In IoT, actual-time data-gathering, monitoring, and decision-making throughout the agricultural value chain are made possible by IoT based-tech, which has developed as a troubleshooting power now for up-to-date farming [14] (as shown in Figure 1). Fundamentally, agriculture has used the IoT for demands with a mixture of radars, actuators, and networked devices positioned throughout farms to collect information on many environmental, agricultural, and animal aspects. Farmers may get important insights into their operations by using these sensors to track dirt-humidity stages, temperature, humidity, the condition of crops, cattle behavior, or the performance of equipment.
The internet plays a major role in agriculture by enabling precision farming, which allows farmers to precisely control inputs like water, fertilizer, and pesticides depending on plant requirements and localized circumstances [14,15]. Farmers may reduce waste, optimize water use, and lessen the chance of over- or under-watering crops by utilizing IoT-enabled smart irrigation systems, for instance. Similar to this, IoT-based monitoring systems are able to identify early indicators of insect infestations, nutritional deficits, or plant stress, enabling prompt interventions and focused treatment plans.
  • Soil Monitoring: An essential component of contemporary agriculture, soil monitoring allows farmers to evaluate the fertility, moisture content, and overall health of their soil in order to maximize crop productivity. The latest technologies tackle consumption augmented with complexity plus the effectiveness of soil monitoring [16]. Fields may be equipped with internet-connected soil sensors to continually monitor important characteristics including temperature, fertilizer concentrations, pH-levels, and moisture content. Growers may customize the real time data from these instruments to make knowledgeable choices regarding soil management, fertilization, and irrigation techniques. Farmers may reduce nutrient leakage, prevent flooding or submerging, and guarantee ideal growth conditions for crops by closely monitoring soil conditions from a distance. Additionally, soil monitoring is essential to sustainable agricultural operations since it makes agricultural precision techniques possible and reduces environmental effect.
  • Machines for routines operations: Regular tasks like planting, spraying, and harvesting frequently need a large amount of time and hard effort. These procedures have been completely transformed by the incorporation of IoT technologies, which have made it possible to create autonomous and intelligent machinery. With sensors, GPS units, and networking capabilities, agricultural equipment that is Internet of Things (IoT) enabled may carry out normal tasks more accurately, efficiently, and independently [17]. With minimum human interaction, autonomous tractors can travel fields and carry out chores like cultivating, sowing, and plowing, maximizing resource efficiency and lowering labor costs. Analogously, IoT-enabled harvesting apparatus can precisely detect ripe crops, modify harvesting methods, and maximize yield results. IoT solutions simplify agricultural processes, increase production, and free up farmers’ time to concentrate on more critical activities by automating mundane operations.
  • Water Management: IoT technology provides creative approaches to agricultural water management, enabling growers to track, save, and maximize water use all through the producing season. IoT technologies enable farmers to remotely monitor and operate irrigation systems, allowing them to adjust irrigation timings and settings by means of computers or mobile devices at any location. Farmers may increase complete farmhouse sustainability, preserve aquatic resources, and upsurge crop yields by putting IoT-driven water management systems into practice.
  • Drone Monitoring: With drone surveillance, farmers can now see their fields and crops from the air, making it a crucial tool for precision agriculture. Drones with cameras, sensors, and GPS systems are able to gather high-quality data and images that offer important insights into crop health, growth trends, insect infestations, and environmental factors [18]. Drones with Internet of Things capabilities are able to fly by themselves or under remote control, taking precise aerial photos of fields and creating 3D models and maps. With this data, farmers can monitor crop progress, pinpoint problem areas, and make well-versed verdicts regarding irrigation, impregnation, and pest running. Early harvest stressor identification made possible by drone surveillance enables prompt responses to minimize yield losses and maximize farm output. Drones can also swiftly and effectively monitor vast agricultural regions.
The uses of IoT to tackle challenging gardening tasks sparked a new phase of fact-based ambitious decision-making and also accuracy farming [18,19]. By giving farmers useful information about the fitness of their dirt and its nutrients levels, soil monitoring devices help them apply fertilizer and manage their crops more effectively. Routine agricultural operations are automated by machines with IoT capabilities, which lowers labor costs and improves operational efficiency.

2.3. Machine Learning in Crop System

In managing the crop system, ML has become a potent instrument that provides creative answers to a range of problems that farmers encounter. The creation of algorithms that allow computers to learn from and examine information, spot designs, and type forecasts without obvious program writing or commands is this fundamental work of machine learning [20]. In agriculture, machine learning algorithms can extract useful insights to maximize crop productivity from the huge sizes of records collected by tools and satellites, besides fields.
As shown in Table 1, Crop-monitoring remains unique among the main uses of machine learning in farming. Real-time-checking of crop health, growth patterns, and environmental conditions may be achieved by ML algorithms through the analysis of satellite data, drones, and ground-based sensors [21]. This makes it possible for farmers to recognize early indicators of stress and respond quickly to avoid yield losses.
Disease detection is yet another essential use. Various agricultural diseases and pest damage can be reliably identified by machine learning models that have been trained on datasets that comprise photos of both healthy and damaged plants [22,23]. Farmers may decrease crops harm in addition the feast of diseases in using image recognition algorithms on smartphones or drones to rapidly assess the health state of their crops and apply tailored treatment measures.
In order to anticipate crop yields based on historical data, weather forecasts, and agronomic practices, machine learning is essential [24,25]. With the help of analysis of variables like temperature, precipitation, crop variety, and soil quality, machine learning-algorithms are clever extremely precise near-crop prediction models that project future yields. With the help of these production projections, farmers may plan planting dates and allocate resources in an intelligent manner [26].
The use of machine-learning on farms takes potential just before completely transforming agricultural production methods. In the end, farmers may contribute to global food security and ecological agricultural growth by increasing productivity, lowering input costs, and mitigating risks related to insect outbreaks and climatic variability by utilizing cutting-edge algorithms and big data analytics [27].

2.4. Agriculture Challenges and Limitations

There are a few important challenges being faced in the development of crop organization, and these are given with some of limitations as shown in Table 2.
The potential for transforming conventional agricultural operations through the addition of the design framework of machine learning technology for cutting-edge cultivation is enormous [28]. To fully reap these advantages, a few obstacles and restrictions must be overcome. Remote locations with poor connections make it problematic to transmit data in real time, while small-scale farmers find it hard to apply advanced technology due to lack of resources [29]. In addition to power supply interruptions and environmental factors, inconsistent data quality and standardization problems impact the dependability of machine learning models.

3. Research Methodology

The system architecture involves preprocessing and analyzing farming data to suggest suitable crops and estimate yields. It utilizes machine learning techniques like Light-GBM, Random Forest, decision tree classifier, and logistic regression to classify crop labels accurately. By integrating IoT and machine learning, it offers yield projections and crop recommendations based on environmental conditions, aiming to maximize agricultural output. The process includes data preprocessing, exploratory data analysis, classification modeling, and output evaluation.

3.1. Architecture of the System

The system architecture with Arduino sensor and devices, illustrated in Figure 2, consists of two main components: hardware components and software. The hardware includes a microcontroller and sensors, which measure soil nutrient levels. These values are then transmitted from the sensors to the microcontroller and further relayed to Firebase, eventually reaching the Android app.

3.2. IoT and ML Architecture

The system’s IoT and ML architectures are depicted in Figure 2. In the IoT setup, Nitrogen, Phosphorus, Potassium, and Humidity values are sent to Firebase via Arduino and ESP32. These data are then forwarded from Firebase to the mobile app for processing and presentation of results. In the ML framework, the process begins with data gathering, then proceeds to storage and pre-processing to make it ready for model fitting. Subsequently, the data are trained within the models and evaluated for performance.

3.3. Data Collection and Preprocessing

In order to comprehend the features of the secondary dataset, preprocessing of agricultural data and conducting exploratory data analysis (EDA) were performed in this phase of the procedure. The secondary dataset was gathered from online repository platforms. The dataset includes labels indicating different kinds of crops together with other parameters including temperature, moisture, p-H, NPK, and rainfall. The study creates machine learning models, especially using LightGBM (Light Gradient Boosting Machine), to predict crop labels based on the provided characteristics after preprocessing and EDA. The models’ excellent accuracy shows how useful they are for tasks including crop recommendation and yield prediction. To further assess the data and model performance, the work provides visualizations including correlation matrices, bar charts, and scatter plots. In order to effectively propose crops and anticipate yields in agriculture, the study presents an integrated strategy that makes use of IoT data and ML-algorithms. This technique shows potential for the way to improve agricultural operations’ sustainability and productivity.

3.4. Workflow Algorithms

The system’s workflow diagram and algorithm are illustrated in Figure 3 and Algorithm 1. Users initially log in or register and then select one of the three modules: Crop Recommendation, Fertilizer Recommendation, or Disease Detection. For crop and fertilizer recommendations, sensor data is retrieved, while fertilizer recommendations require an additional input such as crop name. Disease detection involves uploading an image for processing. To calculate fertilizer requirements, users input fertilizer name, nutrients, application rate per 1000 sqft, and application area. After processing, the system displays results for fertilizer, nitrogen, phosphorus, and potassium amounts.
Algorithm 1: User Workflow for Agricultural Recommendations
1. Initialization

2. if User is Logged in or Signed up then
3.   if User selects Crop Recommendation then
4.    Power up the device
5.    Send data to backend for crop recommendation
6.    Output: Display suitable crop name
7.   end

8.   if User selects Fertilizer Recommendation then
9.    Power up the device
10.     Send data to backend for fertilizer recommendation
11.     Input: Select crop name and specify area
12.     Output: Display recommended fertilizer name
13.  end

14.  if User selects Disease Detection then
15.     Open camera
16.     Upload image for analysis
17.     Output: Display detected disease name and relevant information
18.  end

19.  if User selects Calculate Fertilizer then
20.     Input: Fertilizer name, selected nutrient, rate per 1000 sqft, and area
21.     Compute: Calculate required amount of fertilizer
22.     Output: Display calculated result
23.  end

24. else
25.  Output: Prompt user to log in or sign up
26. end
The communication with Arduino utilizes the Modbus protocol, which is open-source and royalty-free. Modbus TCP enables data transmission across Ethernet TCP/IP networks, as well as RS-485, RS-422, and RS-232 interfaces. To validate the accuracy and reliability of the soil moisture meter used in this study, comparisons were made with other established moisture measuring techniques.
Soil moisture meters are devices that are placed at various depths within the soil to measure moisture levels. These meters help determine how much water is available to plants by monitoring changes in soil moisture content. By installing meters at different depths, we can gain insights into how moisture is distributed throughout the root zone. This information is crucial for optimizing irrigation strategies and ensuring that plants receive the right amount of water for their growth.

3.5. Software Structure Design

The main circuit design shown in Figure 3 consists of the following components and connections:
  • Power Source: Supplies power to the entire circuit. The power source is connected to the step-down transformer to convert the voltage to a suitable level for the other components.
  • Step-Down Transformer: Converts the high voltage from the power source to a lower voltage suitable for the ESP32 and other sensors. The output of the step-down transformer is connected to the ESP32.
  • ESP32:
    -
    Acts as the central processing unit of the system.
    -
    Receives power from the step-down transformer.
    -
    Connects to the RS485 module for communication.
    -
    Interfaces with the Arduino to relay information and control signals.
  • RS485: A communication module used for long-distance and noise-immune data transmission. Connected to the ESP32 to facilitate data exchange between the ESP32 and other devices.
  • Arduino:
    • Serves as an intermediary microcontroller to manage sensor data.
    • Connected to the RS485 for data reception and transmission.
    • Interfaces with both the NPK sensor and the capacitive moisture sensor to gather environmental data.
  • NPK Sensor:
    • Measures the nutrient levels in the soil (Nitrogen, Phosphorus, Potassium).
    • Connected to the Arduino for data collection.
  • Capacitive Moisture Sensor:
    -
    Measures soil moisture levels.
    -
    Connected to the Arduino to provide moisture data.
    The connections are as follows:
    • Power Source to Step-Down Transformer: Direct connection to provide initial voltage.
    • Step-Down Transformer to ESP32: ** Provides the necessary operating voltage for the ESP32.
      • ESP32 to RS485: ** Data lines connected for communication.
      • RS485 to Arduino: ** Communication lines connected for data exchange.
      • Arduino to NPK Sensor: ** Sensor data lines connected for nutrient measurement.
      • Arduino to Capacitive Moisture Sensor: ** Sensor data lines connected for moisture measurement.
This detailed circuit design ensures efficient data collection and transmission for precise agricultural monitoring.
Backend: Google Firebase’s real-time database was utilized to transmit hardware-collected data to the mobile app and maintain historical records. Firebase’s NoSQL cloud-hosted database allows seamless storage and synchronization of data across multiple clients in real-time, providing features such as real-time synchronization, offline data accessibility, and automatic conflict resolution using a JSON data format.

3.6. Test and Results Evaluations

We carefully evaluated our machine learning models’ performance during the testing and results evaluation stages to make sure they would work well in practical agricultural applications. We divided our dataset into training and testing subsets using methods like cross-validation, which allowed for reliable validation of the models. We evaluated the models’ capacity to correctly identify and forecast agricultural outcomes using measures including accuracy, precision, re-call, and F1-scores. We made sure the models we use and assessment methods were ready for use in actual agricultural settings by repeatedly improving them. Accurate and trustworthy forecasts are crucial to successful management of crops and yield improvement.
Table 3 represents a brief overview of the 2200 rows and 8 columns of the dataset. These columns provide information on temperature, humidity, rainfall, potash (K), phosphoric (P), nitrogen (N), and the appropriate labels. The following table provides essentials on the accuracy of each model. These measures show how effectively each model categorizes the dataset and shed light on how useful they are for the purpose of classification.
The results column showcases the success rates of these tasks summarized in Table 4, with percentages ranging from 90% to 100%. This suggests a generally high level of proficiency in task execution across the board. Looking at the “No. of Attempts (M ± SD)” column, which represents the mean number of attempts along with the standard deviation, we observe that participants or users made differing numbers of attempts to complete tasks. Moving to the “Task Completion Time (M ± SD)” column, which presents the mean completion time along with its standard deviation, we see variations in the time taken to accomplish tasks.
In Figure 4 Agricultural Practice: Irrigation, the variations in soil moisture levels are primarily due to irrigation events. During the monitoring period, irrigation was applied at regular intervals to maintain optimal soil moisture for crop growth. Soil moisture meters are critical tools used in agricultural practices to monitor the water content in the soil at various depths. These meters are strategically installed at different soil depths (e.g., 10 cm, 30 cm, 60 cm) to provide a comprehensive profile of soil moisture levels throughout the root zone of the plants. The peaks in the graph correspond to periods immediately following irrigation, while the gradual decline represents water absorption by plants and evaporation from the soil. In Figure 4, the nitrogen levels required for crop development are depicted in the line plot. The amount of nitrogen required begins at 90 units at a ratio of 0.0. Then, at 2.0 data points, it starts to decrease to 60 units, and then it starts to rise once again at 3.0 data points, achieving a level of 75 units. This pattern shows significant increases and decreases in the amount of nitrogen required during the development of the crop cycle. Figure 4 shows a sharp decline followed by recovery, likely due to a temporary disruption like pesticide use or irrigation changes.
Figure 5 provides a line plot showing the phosphorus levels. The changes in soil nutrient levels (Nitrogen, Phosphorus, and Potassium) are the result of fertilization practices. Fertilizers were applied at specific intervals to ensure adequate nutrient availability for the crops. The spikes in nutrient levels in the graph indicate the times when fertilizers were added to the soil. Over time, the levels decrease as the nutrients are absorbed by plants and leached out of the soil as required for crop development. Starting from 0.0, the ratio shows that 43 units are needed. When the data point approaches 1.0, the level drops precipitously to 90 units. After 3.0 data points, it starts to decrease even more, reaching a value of 35 units. Figure 5 peaks early and then declines, suggesting a successful short-term intervention like nutrient-rich fertilizer that loses effectiveness over time.
The line plot shows in Figure 6 the potash K levels required for crop development. Starting from 0.0, the ratio shows that 43 units are needed. When the data point approaches 1.0, the level drops precipitously to 41 units. Then, after 3.0 data points, it starts to decrease even further, reaching a value of 40 units. For environmental monitoring, the fluctuations in sensor readings for Figure 6 are attributed to changes in environmental conditions such as temperature, humidity, and sunlight. These factors can influence the sensor readings independently of any direct agricultural practices. The data helps in understanding the environmental impact on soil conditions and sensor performance. Figure 6 shows a balanced rise and fall, which may reflect a controlled experiment where a growth stimulant was applied and later removed.
The confusion matrix provides a detailed breakdown of the model’s performance in classifying the soil conditions. The values in the confusion matrix help in understanding the distribution of correct and incorrect predictions made by the model, Table 5 provides the model’s performance metrics and confusion matrix, detailing the accuracy of predictions. A high number of true positives and true negatives indicates that the model performs well in identifying both positive and negative instances accurately.

3.7. Model Comparisons

In this comparison, we evaluated four implemented ML models to measure their accuracy and other evaluation metrics, as shown in Table 6.
The evaluation of several machine learning algorithms shows encouraging outcomes in terms of yield prediction and crop recommendation. Based on environmental parameters and previous information, the Light-GBM-Classifier, Decision-Tree-Classifier, and Random-Forest-Classifier demonstrate resilience in selecting eligible crops with high accuracy scores above 98%, and precision, recall, and F1-scores consistently around 99%. These models support precision farming and resource optimization by providing trustworthy advice on the best crops to plant and how much yield to expect. In situations when computing resources are restricted, the Logistic-Regression model is a useful tool for crop recommendation and yield prediction since it retains reasonable precision, and other above metrics are measuring performance despite having a somewhat lower accuracy. All things considered, these results demonstrate how machine learning may improve farming methods and support the production of food in a sustainable manner.

3.8. Performance Comparison of Soil Moisture Measurement Methods

In our study, the performance of the soil moisture meter was evaluated against several established methods, including tensiometers, various commercial moisture meters, and the standard oven drying method at 105 °C. As shown in Table 7 below, our soil moisture meter demonstrated a high accuracy rate of 99% and consistent reliability. When compared to tensiometers, the meter showed a strong correlation (r = 0.95), indicating that it provides comparable moisture readings. Similarly, the meter performed on par or better than commercial moisture meters, which generally have an accuracy variance of ±10%. Additionally, the meter’s measurements were within ±3% of those obtained using the standard oven method, further validating its precision. These results confirm that the soil moisture meter is not only reliable but also highly effective for use in precision agriculture, where accurate soil moisture management is critical for optimizing crop yields and water use efficiency.

4. Discussion

The results from the IoT-based soil monitoring system demonstrate its significant potential in enhancing precision agriculture practices. By enabling continuous monitoring of essential soil parameters, the system provides valuable insights that can improve crop yields and optimize resource use. The variations observed in Figure 4, Figure 5 and Figure 6 reflect the system’s sensitivity to different farming practices, suggesting that it can effectively detect and respond to subtle changes in soil conditions. This sensitivity is crucial for making informed adjustments in agricultural techniques to enhance overall productivity.
The confusion matrix in Table 5 further supports the system’s effectiveness, showcasing its robustness in accurately classifying soil conditions. With metrics such as 0.92 accuracy, 0.90 precision, and 0.91 recall, the system has proven its capability in differentiating various soil states, thereby minimizing the risk of misclassification. These results highlight the reliability of the machine learning algorithms used, which have been optimized to handle the IoT data with high precision.
Despite these promising results, there is still room for improvement. The current system relies on a limited number of sensors and data processing methods. Expanding the system to include additional sensors that can monitor other critical environmental factors, like humidity, light intensity, and soil nutrients, could further enhance its effectiveness. Additionally, refining the data processing algorithms, potentially incorporating advanced techniques like deep learning, may improve the system’s predictive accuracy and overall performance.
It is also important to consider the scalability and adaptability of the system across different agricultural settings. While the model has shown strong performance in the tested scenarios, further validation in diverse geographic regions with varying soil types and climatic conditions is necessary. Addressing these challenges will be key to ensuring the system’s broader applicability and effectiveness in a variety of farming environments.
In summary, the IoT-based soil monitoring system represents a significant advancement in precision agriculture. By providing real-time, accurate data on soil conditions, it enables farmers to make more informed decisions, leading to better crop management and resource utilization. Ongoing research and development will be crucial to addressing the current limitations and fully realizing the system’s potential, thereby contributing to the sustainability and productivity of modern agriculture.

5. Conclusions

Our study has demonstrated that employing machine learning models to predict crop recommendations and yields, alongside a highly accurate soil moisture meter, yields exceptional results. The soil moisture meter achieved a 99% effectiveness rate and proved reliable when compared with tensiometers, various commercial moisture meters, and the standard oven method, confirming its precision and suitability for precision agriculture. Our machine learning models, such as the Light-GBM-Classifier, Decision-Tree-Classifier, and Random-Forest-Classifier, exhibited accuracy rates of approximately 98%, while the Logistic Regression model, although slightly less accurate, remains practical in scenarios with limited computational resources.
Despite these promising results, a critical challenge persists: effectively implementing these technologies in real-world agricultural settings. While our findings support the efficacy of these tools, broader adoption will depend on overcoming obstacles related to producer awareness and training. Ensuring that farmers are informed and equipped to use these technologies is essential for translating research advancements into practical benefits on the ground.
In conclusion, while the integrated use of IoT data and machine learning algorithms presents significant potential for enhancing agricultural practices, addressing the gap between technology and its practical application remains a vital step. Future efforts should aim not only at further technological innovation but also at facilitating successful technology adoption among producers.

Author Contributions

Writing—original draft preparation, M.B.; supervision, B.H., K.D., S.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

No new data were created or analyzed in this study.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Apat, S.K.; Mishra, J.; Raju, K.S.; Padhy, N. The robust and efficient Machine learning model for smart farming decisions and allied intelligent agriculture decisions. J. Integr. Sci. Technol. 2022, 10, 139–155. [Google Scholar]
  2. Bakthavatchalam, K.; Karthik, B.; Thiruvengadam, V.; Muthal, S.; Jose, D.; Kotecha, K.; Varadarajan, V. IoT framework for measurement and precision agriculture: Predicting the crop using machine learning algorithms. Technologies 2022, 10, 13. [Google Scholar] [CrossRef]
  3. Bhattacharya, S.; Pandey, M. An Integrated Decision-Support System for Increasing Crop Yield Based on Progressive Machine Learning and Sensor Data. Int. J. Intell. Syst. Appl. Eng. 2023, 11, 272–284. [Google Scholar]
  4. Bhoi, A.; Nayak, R.P.; Bhoi, S.K.; Sethi, S.; Panda, S.K.; Sahoo, K.S.; Nayyar, A. IoT-IIRS: Internet of Things based intelligent-irrigation recommendation system using machine learning approach for efficient water usage. PeerJ Comput. Sci. 2021, 7, e578. [Google Scholar] [CrossRef]
  5. Bhavanandam, S. Wcp: Weather-based crop yield prediction using machine learning and big data analytics. Technology 2022, 3, 4. [Google Scholar]
  6. Champaneri, M.; Chachpara, D.; Chandvidkar, C.; Rathod, M. Crop Yield Prediction Using Machine Learning. Int. J. Sci. Res. 2020, 9, 2. [Google Scholar]
  7. Chlingaryan, A.; Sukkarieh, S.; Whelan, B. Machine learning approaches for crop yield prediction and nitrogen status estimation in precision agriculture: A review. Comput. Electron. Agric. 2018, 151, 61–69. [Google Scholar] [CrossRef]
  8. Durai, S.K.S.; Shamili, M.D. Smart farming using machine learning and deep learning techniques. Decis. Anal. J. 2022, 3, 100041. [Google Scholar] [CrossRef]
  9. Elbasi, E.; Zaki, C.; Topcu, A.E.; Abdelbaki, W.; Zreikat, A.I.; Cina, E.; Shdefat, A.; Saker, L. Crop prediction model using machine learning algorithms. Appl. Sci. 2023, 13, 9288. [Google Scholar] [CrossRef]
  10. Gupta, S.; Geetha, A.; Sankaran, K.S.; Zamani, A.S.; Ritonga, M.; Raj, R.; Ray, S.; Mohammed, H.S. Machine learning-and feature selection-enabled framework for accurate crop yield prediction. J. Food Qual. 2022, 2022, 6293985. [Google Scholar] [CrossRef]
  11. Ikram, A.; Aslam, W.; Aziz, R.H.H.; Noor, F.; Mallah, G.A.; Ikram, S.; Ahmad, M.S.; Abdullah, A.M.; Ullah, I. Crop Yield Maximization Using an IoT-Based Smart Decision. J. Sens. 2022, 2022, 2022923. [Google Scholar] [CrossRef]
  12. Maheswary, A.; Nagendram, S.; Kiran, K.U.; Ahammad, S.H.; Priya, P.P.; Hossain, M.A.; Rashed, A.N.Z. Intelligent Crop Recommender System for Yield Prediction Using Machine Learning Strategy. J. Inst. Eng. Ser. B 2024, 105, 979–987. [Google Scholar] [CrossRef]
  13. Satterthwaite, D.; Mcgranahan, G.; Tacoli, C. Urbanization and its implications for food and farming. Philos. Trans. R. Soc. Ser. B 2010, 365, 2809–2820. [Google Scholar] [CrossRef]
  14. Mekonnen, Y.; Namuduri, S.; Burton, L.; Sarwat, A.; Bhansali, S. Machine learning techniques in wireless sensor network based precision agriculture. J. Electrochem. Soc. 2019, 167, 037522. [Google Scholar] [CrossRef]
  15. Pande, S.M.; Ramesh, P.K.; Anmol, A.; Aishwarya, B.R.; Rohilla, K.; Shaurya, K. Crop recommender system using machine learning approach. In Proceedings of the 2021 5th International Conference on Computing Methodologies and Communication (ICCMC), Erode, India, 8–10 April 2021; IEEE: New York, NY, USA, 2021; pp. 1066–1071. [Google Scholar]
  16. American Farm Bureau Federation. Agriculture Labor Shortages Pose Long-Term Challenges. In Proceedings of the American Farm Bureau Federation, Atlanta, GA, USA, 7–12 January 2022. [Google Scholar]
  17. Parameswari, P.; Rajathi, N.; Harshanaa, K.J. Machine learning approaches for crop recommendation. In Proceedings of the 2021 International Conference on Advancements in Electrical, Electronics, Communication, Computing and Automation (ICAECA), Coimbatore, India, 8–9 October 2021; IEEE: New York, NY, USA, 2022; pp. 1–5. [Google Scholar]
  18. Priya, P.K.; Yuvaraj, N. A survey on deep learning based IoT approach for precision crop suggestion. Int. J. Res. Appl. Sci. Eng. Technol. 2019, 7, 389–395. [Google Scholar] [CrossRef]
  19. Rashid, M.; Bari, B.S.; Yusup, Y.; Kamaruddin, M.A.; Khan, N. A comprehensive review of crop yield prediction using machine learning approaches with special emphasis on palm oil yield prediction. IEEE Access 2021, 9, 63406–63439. [Google Scholar] [CrossRef]
  20. Rani, S.; Mishra, A.K.; Kataria, A.; Mallik, S.; Qin, H. Machine learning-based optimal crop selection system in smart agriculture. Sci. Rep. 2023, 13, 15997. [Google Scholar] [CrossRef]
  21. Rehman, A.; Liu, J.; Keqiu, L.; Mateen, A.; Yasin, M.Q. Machine learning prediction analysis using IoT for smart farming. Int. J. 2020, 8, 1–6. [Google Scholar]
  22. Rezk, N.G.; Hemdan, E.E.D.; Attia, A.F.; El-Sayed, A.; El-Rashidy, M.A. An efficient IoT based smart farming system using machine learning algorithms. Multimed. Tools Appl. 2021, 80, 773–797. [Google Scholar] [CrossRef]
  23. Reshma, R.; Sathiyavathi, V.; Sindhu, T.; Selvakumar, K.; SaiRamesh, L. IoT based classification techniques for soil content analysis and crop yield prediction. In Proceedings of the 2020 Fourth International Conference on I-SMAC (IoT in Social, Mobile, Analytics and Cloud) (I-SMAC), Palladam, India, 7–9 October 2020; IEEE: New York, NY, USA, 2020; pp. 156–160. [Google Scholar]
  24. Reddy, G.V.; Reddy, M.V.K.; Spandana, K.; Subbarayudu, Y.; Albawi, A.; Chandrashekar, R.; Singla, A.; Praveen, P. Precision farming practices with data-driven analysis and machine learning-based crop and fertiliser recommendation system. In Proceedings of the E3S Web of Conferences, Yogyakarta, Indonesia, 12–13 December 2023; EDP Sciences: Les Ulis, France, 2024; Volume 507, p. 01078. [Google Scholar]
  25. Senapaty, M.K.; Ray, A.; Padhy, N. IoT-enabled soil nutrient analysis and crop recommendation model for precision agriculture. Computers 2023, 12, 61. [Google Scholar] [CrossRef]
  26. Sivakumar, R.; Prabadevi, B.; Velvizhi, G.; Muthuraja, S.; Kathiravan, S.; Biswajita, M.; Madhumathi, A. Internet of things and machine learning applications for smart precision agriculture. IoT Appl. Comput. 2022, 2022, 135–165. [Google Scholar]
  27. Sutha, K.; Indumathi, N.; Shankari, S. Recommending and Predicting Crop Yield using Smart Machine Learning Algorithm (SMLA). Curr. Agric. Res. J. 2023, 11, 686–694. [Google Scholar] [CrossRef]
  28. Van Klompenburg, T.; Kassahun, A.; Catal, C. Crop yield prediction using machine learning: A systematic literature review. Comput. Electron. Agric. 2020, 177, 105709. [Google Scholar] [CrossRef]
  29. Kolipaka, V.R.R.; Namburu, A. An automatic crop yield prediction framework designed with two-stage classifiers: A meta-heuristic approach. Multimed. Tools Appl. 2024, 83, 28969–28992. [Google Scholar] [CrossRef]
Figure 1. IoT in Agriculture.
Figure 1. IoT in Agriculture.
Iot 05 00028 g001
Figure 2. Architecture proposed of IoT-Based Crop Prediction System with Machine Learning.
Figure 2. Architecture proposed of IoT-Based Crop Prediction System with Machine Learning.
Iot 05 00028 g002
Figure 3. Main Circuit Design.
Figure 3. Main Circuit Design.
Iot 05 00028 g003
Figure 4. Nitrogen level Line plots.
Figure 4. Nitrogen level Line plots.
Iot 05 00028 g004
Figure 5. Phosphorous level in crops.
Figure 5. Phosphorous level in crops.
Iot 05 00028 g005
Figure 6. Potassium (K) Level.
Figure 6. Potassium (K) Level.
Iot 05 00028 g006
Table 1. ML Application in crop.
Table 1. ML Application in crop.
ApplicationDescription
Crop MonitoringReal-time monitoring of crop health, growth trends, and environmental conditions is achieved by the analysis of sensor data, drone footage, and satellite pictures by machine learning algorithms.
Disease DetectionVarious agricultural diseases and pest damage can be reliably identified by machine learning models that have been trained on datasets that comprise photos of both healthy and damaged plants.
Yield PredictionUtilizing historical data, weather forecasts, and agronomic practices, algorithmic learning algorithms create predictive models that project crop yields in the future for profitability and resource efficiency.
Table 2. Agricultural Challenges and Limitations in Technology Adoption.
Table 2. Agricultural Challenges and Limitations in Technology Adoption.
ChallengeDescription
Technical QualificationsMany rural producers lack the technical skills needed to effectively use and maintain new technologies
Rural Extension ServicesSignificant difficulties exist in providing adequate extension services to educate producers about new technologies.
Access to TechnologyReaching technology in remote rural areas is challenging due to infrastructure and logistical issues.
Educational BarriersProducers with limited formal education, particularly those with minimal schooling, find it difficult to adopt and utilize new technologies.
Training and SupportLack of ongoing training and support for rural producers hinders the effective implementation of new technologies.
Financial ConstraintsHigh costs of technology and implementation can be prohibitive for small-scale producers.
Table 3. Dataset overview information.
Table 3. Dataset overview information.
NPKTemperatureHumiditypHRainfallLabel
90424320.87974482.0027446.502985202.935536Rice
85584121.77046280.3196447.038096226.655537Rice
60554423.00445982.3207637.840207263.964248Rice
74354026.49109680.1583636.980401242.864034Rice
78424220.13017581.6048737.628473262.717340Rice
Table 4. Results of Task Verification for Different Modules.
Table 4. Results of Task Verification for Different Modules.
TaskModuleResultsNo. of Attempts (M ± SD)Task Completion Time (M ± SD)No. of Times Help (M ± SD)
T1: Verify LoginSW100%1 ± 0.541.3 ± 0.440.6 ± 0.54
T2: Verify Crop RecommendationHW & SW96%1 ± 03 ± 00 ± 0
T3: Verify Fertilizer RecommendationHW & SW94%1 ± 03 ± 00 ± 0
T4: Disease DetectionSW100%1 ± 02 ± 00.4 ± 0.54
T5: Calculation of FertilizerSW100%1 ± 01.2 ± 0.440 ± 0
Table 5. Model Performance Metrics and Confusion Matrix.
Table 5. Model Performance Metrics and Confusion Matrix.
MetricValue
Accuracy0.92
Precision0.90
Recall0.91
F1 Score0.90
Predicted PositivePredicted Negative
Actual PositiveTrue Positive (TP)
91
False Negative (FN)
9
Actual NegativeFalse Positive (FP)
10
True Negative (TN)
1
True Positive (TP): Number of actual positive instances correctly classified as positive. False Negative (FN): Number of actual positive instances incorrectly classified as negative. False Positive (FP): Number of actual negative instances incorrectly classified as positive. True Negative (TN): Number of actual negative instances correctly classified as negative.
Table 6. Models Comparisons.
Table 6. Models Comparisons.
ModelAccuracyPrecisionRecallF1-Score
Light GBM Classifier98.90%99%99%99%
Decision Tree Classifier98.48%99%98%99%
Random Forest Classifier99.31%99%99%99%
Logistic Regression94.35%94%95%94%
CropsPrecisionRecallsF1-ScoresSupport
apple1.001.001.0031
banana1.001.001.0032
black gram0.850.830.8435
chickpea1.001.001.0039
coconut0.941.000.9730
coffee1.001.001.0032
cotton0.851.000.9228
grape1.001.001.0033
jute0.850.900.8831
kidney bean0.910.970.9430
lentil0.890.920.9126
maize0.960.830.8929
mango0.911.000.9529
moth bean0.850.850.8539
mung bean1.000.970.9831
muskmelon1.001.001.0031
orange1.00 1.001.0040
Table 7. Comparison of Soil Moisture Meter Performance with Various Measurement Methods.
Table 7. Comparison of Soil Moisture Meter Performance with Various Measurement Methods.
MethodDescriptionPerformance MetricsComparison Results
Soil Moisture MeterDevice installed at various soil depths to measure soil moisture content.Accuracy: 99%, Reliability: HighReliable measurements with consistent results.
TensiometerMeasures soil water tension, indicating moisture levels indirectly.Accuracy: ±5% of reference valuesStrong correlation (r = 0.95) with our meter readings.
Commercial Moisture MetersVarious commercial models used for measuring soil moisture.Accuracy: Varies (generally ±10%)Our meter performed comparably or better in terms of accuracy and consistency.
Standard Oven MethodSoil samples are dried in an oven at 105 °C to determine moisture content by weight loss.Accuracy: Considered as a reference methodOur meter’s measurements were within ±3% of the oven method, validating its accuracy.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Bouni, M.; Hssina, B.; Douzi, K.; Douzi, S. Integrated Iot Approaches for Crop Recommendation and Yield-Prediction Using Machine-Learning. IoT 2024, 5, 634-649. https://doi.org/10.3390/iot5040028

AMA Style

Bouni M, Hssina B, Douzi K, Douzi S. Integrated Iot Approaches for Crop Recommendation and Yield-Prediction Using Machine-Learning. IoT. 2024; 5(4):634-649. https://doi.org/10.3390/iot5040028

Chicago/Turabian Style

Bouni, Mohamed, Badr Hssina, Khadija Douzi, and Samira Douzi. 2024. "Integrated Iot Approaches for Crop Recommendation and Yield-Prediction Using Machine-Learning" IoT 5, no. 4: 634-649. https://doi.org/10.3390/iot5040028

APA Style

Bouni, M., Hssina, B., Douzi, K., & Douzi, S. (2024). Integrated Iot Approaches for Crop Recommendation and Yield-Prediction Using Machine-Learning. IoT, 5(4), 634-649. https://doi.org/10.3390/iot5040028

Article Metrics

Back to TopTop