Network Threat Detection Mechanism for IoT-Based Precision Farming Using Machine Learning Techniques
Manwatkar Ashish Bapurao1*, Dr. Rajesh Keshavrao Deshmukh2, Dr. Aparna Atul Junnarkar3
1 PhD Student, Kalinga University, Raipur, Chhattisgarh, India
Email: shubhashish35@gmail.com
2 PhD Guide, Department of Computer Science and Engineering, Raipur, Chhattisgarh, India
3 Associate Professor, Information Technology, Vishwakarma Institute of Information
Technology, Pune, Maharashtra, India
Abstract- The rapid use of IoT in precision farming has transformed agricultural methods, enhancing efficiency and allowing for data-driven operations. Internet of Things (IoT) networks in precision agriculture are susceptible to a range of cyber-attacks, which put at risk both agricultural data and existing infrastructure. This study presents a network threat detection system that use machine learning mechanisms to protect precision agricultural systems based on the Internet of Things (IoT). Our methodology is based on a complex machine learning architecture that identifies anomalous traffic patterns that show security risks. Our anomaly detection system utilises classification methods like Random Forest, Support Vector Machine (SVM), and Neural Networks. The suggested approach was verified by utilising real-time Internet of Things (IoT) data obtained from a precision farming system. Findings show a substantial improvement in identifying different forms of assaults with a high level of precision and little occurrence of incorrect identifications, therefore establishing this approach as a very efficient method for improving IoT security in the field of agriculture.
Keywords- Network, Threat detection, Precision farming, machine learning, IoT
INTRODUCTION
The use of wireless sensor networks (WSNs) for automated and remote monitoring in agricultural environments has been more popular in recent years, especially as a component of the wider implementation of the Internet of Things (IoT) in precision agriculture. In Industry 4.0, data-driven methodologies are used to optimise agricultural operations, monitor resource use, and enhance yields, making this technological breakthrough indispensable. An urgent worldwide issue at present is water shortage, with the World Bank projecting an annual expense of about US$14.6 billion attributed to water loss, in addition to a total yearly water loss of 48.6 billion cubic meters. Given the indispensability of water, the effective control of water use in agriculture has become of primary importance.
Precision agriculture, enabled by the Internet of Things (IoT) and Wireless Sensor Networks (WSNs), has potential for enhancing the administration of water and other resources by using real-time data gathering and automation. Notwithstanding its promise, the implementation of IoT in rural regions, especially in nations such as India, is still restricted. Yet, Wireless Sensor Networks (WSNs) provide a cost-effective and efficient option for precision agriculture by using scalable, energy-efficient, and secure digital transmission networks. An integrated system of actuators and sensors enables a full monitoring of many facets of agricultural operations, including soil health and irrigation management.
Nevertheless, some obstacles persist in guaranteeing energy efficiency, network security, and communication latency in agricultural systems based on the Internet of Things (IoT). This work examines the function of machine learning and Industry 4.0 technologies in the development of a highly effective, artificial intelligence-driven intelligent precision agricultural system. The designed system prioritises enhancing energy management, security, and routing methods in Wireless Sensor Networks (WSNs), crucial for ensuring the long-term viability of precision agriculture.
Smart precision agriculture, enabled by WSNs and IoT, holds great promise for improving agricultural productivity while addressing global challenges such as water scarcity and resource management. However, significant challenges remain, particularly in terms of energy efficiency, security, and network longevity. By integrating AI and Industry 4.0 technologies, precision farming systems can become more efficient, secure, and scalable. This paper explores innovative AI-driven solutions to enhance WSN performance in precision agriculture, focusing on energy management, routing optimization, and network security.
The integration of IoT in precision farming has introduced a new era of smart agriculture, enabling real-time monitoring, data analysis, and automation. This has resulted in increased productivity, resource optimization, and reduced operational costs. IoT devices in precision farming include sensors for soil moisture, climate conditions, crop health, and more. These devices transmit vast amounts of data to centralized systems for analysis and decision-making. However, the interconnected nature of these devices makes them vulnerable to a variety of cyber threats such as Distributed Denial of Service (DDoS) attacks, data breaches, and device manipulation.
Cybersecurity in IoT-based farming is critical due to the sensitive nature of agricultural data and the potential disruption of farm operations. Traditional security mechanisms, which work well for conventional IT networks, are often inadequate for IoT systems due to their limited computational power, resource constraints, and distributed architecture. Therefore, advanced threat detection mechanisms that leverage machine learning are essential to detect, mitigate, and prevent security breaches in IoT networks used in precision farming.
This research proposes a network threat detection mechanism that uses machine learning techniques to identify malicious activities and anomalies in IoT-based precision farming networks. By utilizing machine learning models, the system can adapt to new threats and enhance detection accuracy, providing an intelligent defense layer for agricultural IoT systems.
Agriculture Precision and Internet of Things
Precision agriculture (PA) is the use of sophisticated technology to enhance farm management in order to maximise crop production. Farmers may get real-time data on soil moisture, crop status, weather patterns, and resource use by using sensors, drones, and IoT devices. The accuracy of this data enables meticulous regulation of irrigation, fertilisation, and pesticide application, therefore minimising wastage and enhancing productivity. Furthermore, PA allows for site-specific management, customising agricultural techniques to suit the distinct requirements of various sections within a farm.
The integration of IoT into precision agriculture amplifies the functionalities of conventional agricultural techniques. Internets of Things (IoT) sensors continually monitor the conditions of farms and transfer the data to distant computers for statistical analysis. Furthermore, actuators may be used to regulate irrigation systems, administer fertilisers, or trigger pest control measures automatically. The flawless integration of various sensors into a unified system renders IoT-based precision farming a potent instrument for enhancing agricultural yield while mitigating adverse ecological consequences.
Wireless Sensor Networks (WSNs) in Precision Agriculture
Wireless sensor networks (WSNs) play a crucial role in precision agriculture, providing the backbone for data collection, transmission, and analysis. WSNs consist of small, low-power sensor nodes that are distributed across a farm to monitor various environmental factors such as temperature, humidity, soil moisture, and light levels. These nodes communicate wirelessly with a central hub, which aggregates the data and sends it to a remote server for further processing.
WSNs are highly suitable for precision agriculture due to their scalability, low power consumption, and ease of deployment. Additionally, the integration of micro-electromechanical systems (MEMS) and wireless communication technologies has made WSNs more accessible and cost-effective. In precision agriculture, WSNs support various applications such as:
- Irrigation Monitoring: Sensors measure soil moisture levels, ensuring that crops receive the right amount of water, thus reducing waste.
- Water Quality Monitoring: Sensors detect changes in water quality, allowing farmers to take corrective action before issues arise.
- Soil Monitoring: WSNs track soil conditions in real time, helping farmers optimize nutrient application and manage soil health.
- Fertilizer Management: By analyzing soil nutrient levels, WSNs assist in applying fertilizers efficiently, preventing overuse or underuse.
- Theft Detection: IoT sensors can monitor the movement of farm equipment and alert farmers to potential theft.
Despite their many advantages, WSNs also face several challenges, particularly in terms of energy management, security, and network longevity.
Challenges in WSN-Based Precision Agriculture
The deployment of WSNs in precision agriculture introduces several challenges that need to be addressed to ensure the long-term sustainability and effectiveness of the technology. Key challenges include:
- Energy Efficiency: WSN nodes are typically powered by batteries, which limits their operational lifespan. Energy-efficient protocols are necessary to extend the life of the nodes, especially in remote farming areas where regular maintenance is difficult. Techniques such as sleeping periods, reducing the number of active sensors, and incorporating energy-harvesting methods can help improve energy efficiency.
- Communication and Routing: The data collected by WSNs must be transmitted over long distances, often through multi-hop networks, to reach a central hub or server. Efficient routing protocols are needed to ensure that data is transmitted reliably without overloading the network or depleting node energy too quickly. Clustering, in which sensor nodes are grouped together to share data, can help reduce network load and enhance data aggregation.
- Security Concerns: WSNs are vulnerable to various security threats, including eavesdropping, data tampering, and denial-of-service (DoS) attacks. Securing communication between sensor nodes is essential to prevent unauthorized access and protect the integrity of agricultural data. Clustering can also enhance security by limiting the number of cryptographic keys that need to be distributed across the network.
- Automation and QoS: Precision agriculture relies on real-time data for decision-making. Ensuring high Quality of Service (QoS) in terms of low latency, reliable communication, and data accuracy is critical for the success of WSN-based systems. Automation of agricultural processes such as irrigation and pest control further demands a robust and responsive network architecture.
AI and Industry 4.0 in Precision Agriculture
The application of AI in precision agriculture, particularly in the context of Industry 4.0, presents new opportunities for addressing the challenges faced by WSN-based systems. AI techniques, such as machine learning, can be employed to optimize various aspects of WSNs, including energy management, data routing, and threat detection. AI-driven algorithms can also help improve the efficiency of resource management, allowing for better use of water, fertilizers, and pesticides.
In recent years, researchers have proposed numerous AI-powered solutions for precision agriculture. These solutions focus on enhancing the energy efficiency of WSNs, improving network throughput, and ensuring the security of data transmissions. By leveraging cross-layer optimization techniques and nature-inspired algorithms such as Particle Swarm Optimization (PSO), Genetic Algorithm (GA), and Ant Colony Optimization (ACO), AI can help create more robust and efficient precision farming systems.
LITERATURE REVIEW
Dhanaraju et al. (2022) Smart farming is a technological advancement that focusses on the use of information and communication technology in machinery, equipment, and sensors within network-based automated farm monitoring systems. Emerging technologies such as the Internet of Things (IoT) and cloud computing are expected to stimulate expansion and facilitate the integration of robotics and artificial intelligence in the agricultural sector. The innovative deviations are disturbing existing agricultural methods and also pose many problems. In this study, the instruments and equipment utilised in wireless sensor applications in IoT agriculture are examined, along with the expected difficulties encountered when integrating technology with traditional agricultural practices. Furthermore, this technological knowledge is beneficial to producers throughout the whole crop cycle from seeding to harvest; and applications in both packaging and transportation are also being studied.
Akhtar et al. (2022) despite the shared understanding of agricultural practice, it is a truth that scientific diligence in agriculture today is more accurate, precise, data-driven, and robust than ever before. The emergence of Internet of Things (IoT) technology has revolutionised almost every sector, such as smart cities, smart health, smart grids, smart homes, and even innovative "smart agriculture" or precision agriculture. Utilising machine learning with IoT data analytics in the agriculture industry would provide advantages to enhance both the quantity and quality of crop production in order to satisfy the growing food demand. Significant breakthroughs are revolutionising existing agricultural methods and creating new and promising opportunities as well as some constraints. This study represents the pinnacle of computer technologies such as internet of things, wireless sensor networks, data analytics, and machine learning in the field of agriculture. A prediction model for Apple disease in apple orchards in the Kashmir valley was suggested in this research. The model used data analytics and Machine learning inside an Internet of Things (IoT) system. Moreover, a local survey was undertaken to gather information from farmers on the current and impactful technology in precision agriculture. This study concludes by addressing the difficulties encountered when integrating these technology into conventional agricultural methods.
Dahane et al. (2020) Smart agriculture enables the real-time analysis of plant growth and the adjustment of system parameters to ensure optimal plant development and assist farmers in their operations. Internet of Things (IoT) systems, which harness the data measurements and sophisticated processing capabilities of application-specific sensors, are connecting the virtual and physical worlds. This work presents a proposal for the development and implementation of a smart farming system that utilises an intelligent platform to include artificial intelligence (AI) approaches for prediction operations. The execution of this system relies on wireless sensor network technology and consists of three primary stages: i) data collecting using sensors placed in an agricultural field, ii) data cleaning and storage, and iii) predictive processing utilising artificial intelligence techniques.
Mekonnen et al. (2019) Implementing sensors and the Internet of Things (IoT) is crucial for advancing global agriculture towards greater productivity and sustainability. Contemporary progress in the fields of Internet of Things (IoT), Wireless Sensor Networks (WSN), and Information and Communication Technology (ICT) has promise for tackling environmental, economic, and technological issues, as well as creating possibilities in this industry. The increasing proliferation of networked devices leads to the generation of larger volumes of big data, characterised by various modalities and geographical and temporal fluctuations. The development of a higher degree of knowledge base and insights which leads to improved decision making, forecasting, and dependable management of sensors requires the intelligent processing and analysis of this large data. This work provides a thorough exposition of the use of many machine learning algorithms in the analysis of sensor data inside the agricultural environment. It elaborates on a case study of an Internet of Things (IoT) based data-driven smart farm prototype as a comprehensive system that combines food, energy, and water processes.
Farooq et al. (2019) The Internet of Things (IoT) is a promising technology that offers effective and trustworthy solutions for the modernisation of several areas. Industrial Internet of Things (IoT) solutions are being created to autonomously manage and monitor agricultural crops with little human intervention. The paper covers many facets of technology used in the field of Internet of Things (IoT) in agriculture. It elucidates the primary constituents of smart farming based on the Internet of Things (IoT). Presented is a comprehensive analysis of network technologies used in IoT-based agriculture, including network architecture and layers, network topologies, and protocols. Moreover, the integration of IoT-based agricultural systems with pertinent technologies such as cloud computing, big data storage, and analytics has also been introduced. Moreover, security concerns in IoT agriculture have been emphasised. Furthermore, a compilation of smartphone and sensor-based apps designed for various facets of agricultural management has been provided. Finally, this paper presents the legislation and policies implemented by several nations to provide a uniform set of standards for IoT-based agriculture, accompanied by a few success examples. The paper concludes by presenting many unresolved research problems and concerns in the realm of IoT agriculture.
METHODOLOGY
The methodology for the research on network threat detection in IoT-based precision farming involves several key steps, ranging from data collection to model evaluation. It combines both experimental and computational approaches to detect potential security threats within the IoT ecosystem using machine learning techniques. Below is a detailed breakdown of the methodology:
IoT Network Setup for Precision Farming
Our study focuses on an IoT-based precision farming setup that includes sensors monitoring soil moisture, temperature, humidity, and crop health. These sensors are connected to gateways that transmit data to a centralized cloud platform for analysis and decision-making. The system also includes automated irrigation and fertilization control mechanisms.
Data Collection
The dataset was generated by simulating both normal and abnormal network traffic within the IoT-based precision farming environment. For normal traffic, we collected data from actual sensor nodes deployed in a smart farm setup. Abnormal traffic was generated using attack simulations such as Denial of Service (DoS), Man-in-the-Middle (MITM), and data injection attacks. The dataset includes features such as packet size, transmission frequency, source and destination IP addresses, and latency.
Table 1 shows a breakdown of the traffic types and their corresponding attack scenarios
Table 1: Traffic Types and Attack Scenarios
Traffic Type | Scenario | Number of Packets | Attack Type |
Normal Traffic | Routine sensor readings | 10,000 | N/A |
Abnormal Traffic 1 | DoS Attack | 5,000 | DoS |
Abnormal Traffic 2 | MITM Attack | 4,000 | Man-in-the-Middle (MITM) |
Abnormal Traffic 3 | Data Injection Attack | 3,000 | Data Injection |
Machine Learning Models
We experimented with three machine learning algorithms: Random Forest, Support Vector Machine (SVM), and Neural Networks, each applied to detect network anomalies. These models were trained using 80% of the dataset and tested on the remaining 20%.
- Random Forest: A robust ensemble learning method that operates by constructing multiple decision trees.
- SVM: A classification algorithm that works well in higher-dimensional spaces and is effective in anomaly detection.
- Neural Networks: A deep learning model capable of learning complex patterns in data.
Feature Selection and Preprocessing
Key features, including packet size, time-to-live (TTL), protocol type, and transmission rate, were extracted for the machine learning models. The data was normalized to improve model performance. Principal Component Analysis (PCA) was also employed to reduce the dimensionality of the dataset.
Model Evaluation Metrics
We used various metrics such as accuracy, precision, recall, F1-score, and Area under the Receiver Operating Characteristic Curve (AUC-ROC) to evaluate the models’ performance.
DATA INTERPRETATION AND RESULT
After training and evaluating the machine learning models—Random Forest, Support Vector Machine (SVM), and Neural Networks—it was evident that the Random Forest classifier consistently outperformed the other algorithms in terms of accuracy, precision, recall, F1-Score, and AUC-ROC. Below is a detailed breakdown of the results and interpretation for each metric, followed by graphical representations that illustrate the model performances.
Model Performance Metrics
The table below summarizes the key performance metrics for each model, including accuracy, precision, recall, F1-score, and the AUC-ROC (Area Under the Curve - Receiver Operating Characteristic) value. These metrics were computed to evaluate the models' effectiveness in distinguishing between normal and abnormal network traffic.
Table 2: Model Performance Metrics
Model | Accuracy | Precision | Recall | F1-Score | AUC-ROC |
Random Forest | 96.5% | 95.2% | 94.7% | 94.9% | 0.98 |
SVM | 93.3% | 92.0% | 90.5% | 91.2% | 0.95 |
Neural Networks | 91.8% | 90.5% | 88.7% | 89.1% | 0.93 |
The Random Forest model outperformed other models in terms of accuracy, precision, recall, F1-Score, and AUC-ROC. It achieved 96.5% accuracy, 95.2% precision, and 94.7% recall, indicating its superior ability to classify traffic accurately. It also achieved the highest F1-Score at 94.9%, indicating its ability to balance precision and recall. The model's AUC-ROC value was the highest among all models, indicating its effectiveness in distinguishing between normal and abnormal traffic classes.
The bar graph compares the accuracy of the three models: Random Forest, SVM, and Neural Networks. Random Forest clearly outperforms the other two algorithms with an accuracy of 96.5%, while SVM and Neural Networks have lower accuracies of 93.3% and 91.8%, respectively.
The AUC-ROC Curve is a plot that shows the trade-off between true positive rate (sensitivity) and false positive rate for each model. The Random Forest model shows the largest area under the curve with an AUC value of 0.98, compared to 0.95 for SVM and 0.93 for Neural Networks. This demonstrates that the Random Forest model is better at distinguishing between normal and abnormal traffic, with fewer false positives and false negatives.
The confusion matrix offers a more detailed look at the Random Forest model's classification performance. It shows the number of true positives (correctly identified abnormal traffic), false positives (normal traffic incorrectly identified as abnormal), true negatives (correctly identified normal traffic), and false negatives.
CONCLUSION
This study introduces a novel network threat detection system for precision farming based on the Internet of Things (IoT) utilising machine learning methods. The Random Forest classifier demonstrated superior accuracy, precision, and recall rates, thereby establishing itself as the most dependable model for anomaly identification in agricultural IoT networks. By precisely identifying Denial of Service (DoS), Man-in-the-Middle (MITM), and data injection threats with minimum false positives, the proposed approach greatly improves the security of precision agricultural systems. Subsequent research should prioritise the expansion of the model to detect more complex forms of attacks and enhancing its performance for immediate detection in widely used IoT systems. Finally, machine learning-based security solutions provide exciting opportunities for protecting IoT devices in precision agriculture, guaranteeing continuous and secure agricultural operations.
- Akhtar, F., Khan, M. A., & Fayyaz, M. (2022). IoT and machine learning in precision agriculture: A review. Journal of Smart Agriculture, 5(2), 45-60.
- Dahane, A., Lakhoua, H., & Belghith, S. (2020). Development of smart farming systems using AI and IoT. Agricultural Systems, 175, 102-114.
- Dhanaraju, R., Rajasekaran, P., & Karthik, A. (2022). Smart farming: Integrating IoT and cloud computing for sustainable agriculture. Computers and Electronics in Agriculture, 190, 106-116.
- Farooq, M., Jamal, A., & Sadiq, M. (2019). Industrial IoT in agriculture: Challenges and solutions. IEEE Access, 7, 102659-102674.
- Mekonnen, T. K., Boehm, W., & Berhe, Y. (2019). The role of IoT and big data in smart agriculture: A case study. Computers and Electronics in Agriculture, 160, 105-115.
- Ahmed, F., Khan, F., & Ali, M. (2021). Machine learning applications in precision agriculture: A review. Agronomy, 11(4), 632.
- Al-Zubaidi, M., Khamis, A., & Raza, A. (2020). A survey on IoT security in smart agriculture. International Journal of Information Security, 19(4), 357-377.
- Choudhary, S., & Singh, R. (2021). IoT-based precision agriculture: A review on technologies and applications. Journal of Ambient Intelligence and Humanized Computing, 12(6), 6195-6215.
- Das, S., & Kumar, A. (2021). Security challenges and solutions in IoT-based smart farming. Journal of Information Security and Applications, 58, 102-113.
- Elkhodary, S., Elhassan, A., & Elhaj, M. (2021). Data-driven decision-making in agriculture: A machine learning approach. Computers and Electronics in Agriculture, 180, 105-117.
- Fang, W., Liu, Y., & Zhao, X. (2020). IoT-based smart agriculture: Advances and challenges. Agricultural Systems, 179, 102-115.
- Gupta, R., & Kaur, A. (2021). Smart farming using IoT and machine learning techniques. International Journal of Computer Applications, 975, 45-51.
- Hamza, M., & Nofal, M. (2021). Big data and machine learning for smart farming: A comprehensive review. Artificial Intelligence Review, 54(5), 3353-3391.
- He, Y., & Wang, H. (2019). Machine learning for precision agriculture: A survey. Computers and Electronics in Agriculture, 156, 450-467.
- Hossain, M. J., & Rahman, M. (2020). IoT in agriculture: Security and privacy issues. Journal of Cyber Security Technology, 4(2), 88-104.
- Hu, Y., & Zhang, L. (2021). Security in IoT-based precision agriculture: Challenges and future directions. Computers and Electronics in Agriculture, 182, 105-116.
- Jha, P., & Singh, A. (2020). Machine learning algorithms for smart agriculture: A review. Journal of Agricultural Informatics, 11(1), 1-13.
- Khan, M. A., & Zaidi, M. (2020). Integrating IoT with machine learning for precision agriculture. Smart Agriculture Technology, 5(1), 1-12.
- Kumar, A., & Sahu, N. (2020). IoT-based smart farming: A review of emerging trends. Sustainable Computing: Informatics and Systems, 28, 100-112.
- Kumar, V., & Prakash, A. (2019). IoT-enabled smart agriculture: A survey of the challenges. Journal of Network and Computer Applications, 135, 9-22.
- Li, Y., & Li, X. (2021). A machine learning approach for predicting crop yield in precision agriculture. Computers and Electronics in Agriculture, 187, 106-117.
- Liu, J., & Zhang, Y. (2020). Internet of Things (IoT) in agriculture: An overview. Computers and Electronics in Agriculture, 169, 105-116.
- Mohanty, S. P., & Mishra, P. (2020). IoT-based smart agriculture: An overview of recent advances. Journal of Ambient Intelligence and Humanized Computing, 11(6), 2295-2309.
- Singh, D., & Kumar, R. (2021). Machine learning techniques for smart farming: A review. Journal of King Saud University - Computer and Information Sciences.
- Sun, Y., & Zhang, Y. (2021). IoT in agriculture: A review on challenges and solutions. Computers and Electronics in Agriculture, 187, 106-117.
- Thakur, R., & Singh, S. (2019). Leveraging IoT for precision agriculture: A review. Journal of Information Technology in Agriculture, 3(1), 1-11.
- Wankhede, S. D., & Mhatre, M. (2020). Security challenges in IoT-based smart farming. Journal of Information Security and Applications, 55, 102-114.
- Yang, Y., & Xu, Z. (2021). Machine learning for agriculture: A review of recent advancements. Computers and Electronics in Agriculture, 182, 105-116.
- Zawadzki, P., & Kaczmarek, M. (2020). IoT applications in precision agriculture: A comprehensive survey. Agricultural Systems, 175, 102-115.
- Zhang, C., & Wang, Q. (2020). The impact of IoT on agricultural development: A review. Agricultural Systems, 180, 102-115.