Journal of Intelligent Systems and Internet of Things

Privacy-Enhanced Digital twin Framework for Smart Livestock Management: A Federated Learning Approach with Privacy-Preserving Hybrid Aggregation (PPHA)

Adel A. Alyoubi
Volume 16, Issue 1, pp. 01-18 (2025)
DOI: https://doi.org/10.54216/JISIoT.160101
Online: https://www.americaspg.com/journal/18/article/3576

Abstract

Through its integration with the Federated Learning (FL) and Digital Twin (DT) technology, Internet of Things (IoT) based smart livestock farming is revolutionized toward real-time health monitoring and predictive analytics combined with secure decision-making. Privacy risks, inefficient models, large computational overheads, and heterogeneous data remain prominent in existing frameworks. This work introduces a “Privacy-Enhanced Digital Twin Livestock Optimization (PEDLO)” system, combining several adaptive and AI-driven components, including IntelliSense-Livestock Monitoring Framework (ISLMF) for multi-sensor data fusion, Privacy-Preserving Hybrid Aggregation (PPHA) Algorithm for secure federated learning, and Digital Twin-Augmented Reinforcement Learning (DTARL) for simulation-based decision-making. The PEDLO system optimizes disease prediction and anomaly detection, aims to reduce false alarms, and ensures data privacy for enhanced livestock welfare. Experimental results show 0.94 of accuracy, 0.93 of anomaly detection sensitivity, and a 40-second model convergence time, which outperform state-of-the-art techniques by a wide margin. The proposed system will enable scalable, efficient, and secure livestock management, marking a transformative shift toward sustainable precision farming.

Keywords: IoT; Federated Learning; Digital Twin; Smart Livestock Farming; Data Privacy; Anomaly Detection; Reinforcement Learning

1. Introduction

Integration of IoT with agricultural production transforms the conventional model of farming practices. IoT enhances the practice with real-time monitoring, data-driven decision-making, and automation, and hence facilitates improvements in welfare conditions, resources usage optimization, and productivity, particularly within a smart livestock environment. Conventional IoT systems often pose a risk related to centralization in handling issues with privacy, security, and scalability regarding data. However, to get over these challenges, Federated Learning (FL) has come as a promising solution that would allow the collaborative training of models across distributed IoT devices without even sharing raw data [1]. Beyond this, the concept of Digital Twin (DT), which is a virtual replica of physical livestock systems, further enhances the effectiveness of smart farming with predictive analytics, real-time monitoring, and scenario-based decision support [2]. The integration of FL and DT with IoT-driven smart livestock environments is a transformative approach to precision livestock farming.

IoT technology has enabled continuous monitoring of the health and behaviour of animals and environmental conditions in livestock farming. Physiological data includes body temperature, heart rate, and movement patterns through sensors, RFID tags, and wearable devices [3]. This data is helpful for early disease detection, feeding strategies and improvement of optimal living conditions of livestock [4]. On the other hand, automated feeding and watering systems reduce labour costs and increase efficiency in resource utilization [5]. However, the traditional cloud-based data processing models pose risks to privacy because sensitive livestock data is transmitted to centralized servers and is vulnerable to cyber threats and unauthorized access [6].

Federated Learning addresses the privacy and security concerns by decentralizing the learning process, enabling IoT devices in different farms to collaboratively train AI models while keeping data locally stored [7]. This technique ensures compliance with data regulations, reduces communication costs, and enhances the robustness of AI models [8]. For example, it is used in disease prediction where multiple farms can contribute knowledge to improve the accuracy of a model in their predictions without compromising individual data [9]. Another benefit of FL lies in the lessening of network congestion, as most data need not be transferred to huge cloud servers centrally [10]. However, challenges remain for FL-based livestock systems, such as heterogeneous data quality, communication overhead, and model convergence, being hot research areas [11].

The Digital Twin concept is about the virtual replica of physical livestock and farm environments. It enables data visualization in real-time, predictive analytics, and simulation-based decision-making [12]. The incorporation of AI models with IoT-driven sensor data offers a comprehensive view of how the livestock is doing, and farmers can consequently take measures to prevent diseases, allocate resources effectively, and increase productivity through such DTs [13]. For instance, DT can replicate how climatic conditions, such as temperature fluctuations, affect animal health. This way, farmers can put into action adaptive strategies [14]. With FL, DT further improves learning efficiency because it uses simulated data to train AI models instead of relying on real-world datasets and training the model much faster [15].

The convergence of IoT, Federated Learning, and Digital Twin technology is turning the paradigm for smart livestock farming, enabling data-driven insights, predictive analytics, and decentralized intelligence. Through FL, this can help address the privacy concerns associated with collaborative learning, whereas DT shall provide a virtual environment to optimize the dimensions of livestock management. Advancements in edge computing, AIdriven analytics and secure data-sharing mechanisms into the future will further enhance applicability in sustainable and efficient livestock farming. The main contribution of the content is as follows:

 The PEDLO System is the first adaptive privacy-preserving AI-based modelling framework integrated with IoT, FL, and DT for smart livestock management.  Development of a Novel ISLMF is an adaptive multi-sensor fusion model for accurate tracking of the health of livestock.  Development of the PPHA Algorithm combining SMPC and Differential Privacy for enhancing security in FL-based AI training.  Development of DTARL is an AI-based predictive model that guides livestock management based on the best practices learned through real-time simulations.

The investigation is as follows. Section 2 covers an extensive literature study, Section 3 provides an explanation of the proposed strategy; Section 4 discusses and presents the simulation output and analysis results, while Section 5 draws the conclusion.

2. Literature Survey

Praharaj et al. [16] proposed the FedTDLR architecture, for improving Federated Learning (FL) performance. The results indicated improved accuracy, F1 score, training time, and memory consumption when using this technique against traditional FL models. It has been observed that EfficientNetB0 was the most accurate model, whereas MobileNetV2 was memory-efficient. Vulnerability to data poisoning attacks and the inability to deal with Non-IID data were some of the limitations of the proposed method. Future work aimed to improve scalability and adversarial robustness using FGSM and PGD-based training methods.

Devaraj et al. [17] introduced RuralAI architecture for the monitoring of tomato crops, with Hierarchical Federated Learning coupled with personalization to allow for localized, adaptive insights. This approach allowed for efficient and privacy-preserving model sharing across farms, using sensor data on the soil, crops, or weather. It challenged regulatory issues across borders and improved scalability over traditional FL. However, restrictions included complexities of real-life agricultural networks, heterogeneous sensor data, and regulations that vary across the borders, demanding more tuning in aggregation and transfer mechanisms in a model.

Shen et al. [18] proposed BAFL-SVM framework to enhance rice pest and disease image recognition using federated learning and enhanced Paillier encryption for secure data sharing. It improved the recognition accuracy by a significant amount along with maintaining the privacy of data in decentralized environments. It also offered a new data management model, which was applicable beyond agricultural domains but was restricted to smart agriculture only. The dataset needed to be expanded to allow effective pest and disease control across wider regions.

Sayed et al. [19] developed a fault detection framework based on Conditional Generative Adversarial Networks (CGANs) and Harris Hawks Optimization (HHO) that was used for advanced fault diagnosis in industrial DT systems. Predictive maintenance increased, downtime was reduced, and operational efficiency was improved. In all cases, the ML-HHO algorithms surpassed the classical models. However, the limitations of this approach were high computational complexity, overfitting risks in CGANs, parameter sensitivity in HHO, and issues related to data quality, which affect scalability and real-time performance in complex industrial environments. Future work would aim to optimize CGANs and integrate additional ML techniques.

Kalyani et al. [20] introduced a DT architecture for smart agriculture, multi-agent systems, cloud–fog–edge computing, and microservices into one system that promotes better management and enhancement of farming operations, irrigation, disease detection, and nutrient management. Improved real-time decision-making and sustainability in precision farming were also results of the said approach. In addition, other limitations of high implementation costs and difficulties in access to data exist, together with integration problems within existing systems, and even problems on privacy concerns. Designing constraints and developing a real-world validation were envisioned for future work.

Medennikov et al. [21] developed a Digital Twin (DT) framework for livestock farming. It brought animal husbandry data together in an integrated digital platform for the management of agricultural enterprises. It enhanced traceability and more standardized data, with digitization within livestock farming. The new feature of co-ownership of DT by industry enterprises reduces the cost of implementation. There are limitations: fragmented adoption of digital, economic feasibility, and integration difficulties across different farms. Future work is about improving data standardization and scalability in real-world applications.

Youssef et al. [22] introduced an end-to-end Digital Twin pipeline for animal research, focusing on energy expenditure estimation and real-time farming applications, such as automated food dispensing. This helped in creating an advanced "laboratory in the wild" for the better analysis of animal behaviour and improving welfare. On the other hand, hype was created about expectations; narrow task focus; and inability to apply at a broader scale. Future work would be targeting the expansion of DT applications, from energy estimation to precision livestock farming and monitoring in real-time.

Barbie et al. [23] proposed a digital twin prototype for the development of embedded software, allowing for virtualized hardware simulation and realistic system testing. This reduced hardware dependency, lowered costs, and improved development efficiency, especially for SilageControl in the ARCHES project. It allowed for parallel development, CI/CD integration, and scenario-based testing. However, it had model abstraction, dependence on high-quality simulations, and difficulties in reproducing real-world conditions. Future work should include improvements to model accuracy and increased automation for complex system behaviour testing.

Praharaj et al. [24] introduced a DT-enhanced multi-layered architecture for CSF to enhance the security and trustworthiness of precision agriculture. A hierarchical federated transfer learning approach was proposed for addressing cyber threats across various layers of systems. The presented framework demonstrated integration in both edge and AWS environments, enhancing data security along with scalability. However, the limitations faced were on the prototype stage and real-world deployment. Future research will work on validating the framework in practical agricultural settings.

Praharaj et al. [25] introduced a CNN-Transformer-based network anomaly detection model for the detection and mitigation of cyberattacks on Cooperative Smart Farming (CSF) systems, including Digital Twin (DT) and physical layers. It employed edge-enabled architecture and created two smart farming network datasets for evaluation. Increased encoder layers enhanced the accuracy of detection but increased memory consumption, creating deployment issues at the edge. Post-quantization was used to decrease memory usage with minor loss in accuracy. Future research sought to design a collaborative anomaly detection model to enhance the overall security of CSF networks.

From the above study it is clear that, in [16] vulnerability to data poisoning attacks; inability to handle Non-IID data; scalability issues, in [17] complex agricultural networks; heterogeneous sensor data; regulatory challenges in model aggregation, in [18] limited application beyond smart agriculture; dataset needs expansion for broader pest control, in [19] high computational complexity; CGAN overfitting risks; HHO parameter sensitivity; data quality issues, in [20] high implementation costs; data access difficulties; integration challenges; privacy concerns, in [21] fragmented digital adoption; economic feasibility concerns; integration difficulties across farms, in [22] hype-driven expectations; narrow task focus; limited applicability beyond energy estimation, in [23] model abstraction; reliance on high-quality simulations; difficulty replicating real-world conditions, in [24] prototypestage constraints; challenges in real-world deployment and validation, in [25] high memory consumption; edge deployment challenges; accuracy trade-off in post-quantization. Hence, there is need for a novelty to overcome these challenges.

3. Proposed Methodology

This research integrates Federated Learning (FL) and Digital Twin (DT) technology within an IoT-enabled framework for the enhancement of agricultural productivity and sustainability in smart livestock environments. The proposed methodology focuses on the capabilities of real-time monitoring, predictive analytics, and decision making while ensuring data privacy, model efficiency, and system adaptability in dynamic agricultural settings. However, smart agriculture with the integration of IoT, DT and FL suffers from critical challenges such as susceptibility to data poisoning, handling Non-IID data, scalability, high computational complexity, regulatory constraints, and difficulties in deployment. Data privacy, model generalization, and applicability in the real world should be addressed to achieve robust, scalable, and cost-effective smart livestock environments. To overcome these issues, a novel “Privacy-Enhanced Digital Twin Livestock Optimization (PEDLO) System” is introduced in this approach. Figure 1 shows the proposed architecture of the PEDLO System.

Figure 1. Architecture of the proposed PEDLO System
Figure 1. Architecture of the proposed PEDLO System

3.1 IoT-Based Livestock Monitoring: Adaptive Sensor Fusion for Precision Farming

Continuous monitoring of health, behaviour, and environmental conditions is crucial to ensure optimal welfare and productivity in smart livestock environments. This paper utilizes wearable sensors, RFID tags, and environmental IoT devices for multimodal sensing of key physiological and behavioural parameters, such as body temperature, heart rate, movement patterns, and feeding behaviours. These will be used in the early detection of diseases, automated resource allocation, and decision-making in real time, all leading to more effective livestock management. Traditional sensor-based monitoring systems are often afflicted with inconsistent data quality due to environmental noise, sensor malfunctions, and the changing conditions within the farm. This paper develops a novel IntelliSense-Livestock Monitoring Framework (ISLMF) that improves the reliability and robustness of the data. The ISLMF will be used to improve precision livestock management by guaranteeing accurate real-time health monitoring, early detection of diseases, and optimized use of resources. ISLMF improves data reliability, minimizes false alerts, and automates decision-making to ensure efficient farm operations through the integration of Adaptive Multi-Sensor Fusion Model, AI-Driven Noise Filtering and Real-Time Anomaly Detection. The framework reduces mortality in livestock, increases productivity, and ensures sustainable farming practices. Its scalability and cloud-edge hybrid processing make it perfect for large-scale and small-scale farms, improving animal welfare, operational efficiency, and cost-effectiveness in smart agriculture. The proposed ISMLF architecture is displayed in the Figure 2.

Figure 2. Architecture of the proposed ISLMF
Figure 2. Architecture of the proposed ISLMF

3.1.1 Adaptive Multi-Sensor Fusion Model

This adaptive model multi-sensor fusion fuses data coming from the harness-worn wearable, RFID tags, and environmental monitors to present the health and behaviour of livestock in a comprehensive and accurate manner. Sensors generate continuous streams of data concerning vital parameters such as body temperature, heart rate, movement patterns, and feeding behaviours, offering real-time tracking of health events. Weight-based aggregation techniques that give more importance to high-confidence data sources, thus eliminating faulty or miscalibrated sensor readings, enhance the reliability of ISLMF. Therefore, it eliminates inconsistency, reduces false alarms, and enhances accuracy in decision-making, which finally helps optimize livestock well-being and farm productivity. The adaptive fusion model combines the data from various sensors (wearable, RFID, and environmental monitors) by considering the weight given to each sensor's confidence level as per the equation (1):

𝐷𝑓𝑢𝑠𝑒𝑑(𝑡) = ∑ 𝑤𝑖(𝑡) ∙𝐷𝑖(𝑡) 𝑁 𝑖=1 (1)

Where, 𝐷𝑓𝑢𝑠𝑒𝑑(𝑡) is the fused data at time 𝑡, 𝑤𝑖(𝑡) is the weight assigned to sensor 𝑖 at time 𝑡, 𝐷𝑖(𝑡) is the data from sensor 𝑖 at time 𝑡, 𝑁 is the total number of sensors. The weight 𝑤𝑖. It is dynamically adjusted by the confidence level or accuracy of each sensor in order to highlight high-confidence sources and suppress faulty readings. To ensure that better sensors get priority, the weight is computed using a confidence metric 𝐶𝑖(𝑡), which include error rates, calibration, or historical accuracy of a given sensor as per the equation (2):

𝐶𝑖(𝑡) ∑ 𝐶𝑖(𝑡) 𝑁 𝑖=1 (2) 𝑤𝑖(𝑡) =

Where, 𝐶𝑖(𝑡) is the confidence score for the sensor 𝑖 at time 𝑡, 𝑁 is the number of sensors. The above equation guarantees that more reliable sensors (higher 𝐶𝑖(𝑡)) will contribute more importantly to the fused data. This equation defines the optimization of health event detection based on sensor data aggregation with a filtering step that removes faulty or miscalibrated readings to avoid false alarms as per the equation (3):

𝐻(𝑡) = ∑ 𝑤𝑖(𝑡) ∙𝑓(𝐷𝑖(𝑡)) 𝑁 𝑖=1 (3)

Where, 𝐻(𝑡) is the optimized health decision or health event detection at time 𝑡, 𝑓(𝐷𝑖(𝑡)) is a filtering function applied on the sensor data 𝐷𝑖(𝑡) to ensure reliability, for example, smoothing, outlier removal, 𝑤𝑖(𝑡) the weight for every data for each sensor associated with its confidence score. These equations together describe how the system aggregates and filters data from a range of sensors, thus allowing accurate real-time monitoring and decision-making about livestock health and behaviour.

3.1.2 AI-Driven Noise Filtering

The AI-Driven Noise Filtering leverages the potential of machine learning-based noise reduction algorithms for increased accuracy and reliability in sensor data in the case of livestock monitoring. It ensures that the identification and eradication of outliers or inconsistencies, erroneous data, occur without decision impacts from faulty or misaligned sensors. Further, ISLMF dynamically changes the sensor thresholding based on real-time analysis of historical behaviour patterns of the livestock and changing environmental conditions. This adaptive approach permits the system automatically to recalculate based on changes in farm conditions. This guarantees high precision and data consistency. As a result, ISLMF greatly enhances livestock health tracking, anomaly detection, and automated decision-making in smart farm environments. Anomalies in the sensor readings will be detected by the noise-filtering model driven by AI and automatically eliminated through applying an anomaly detection function 𝐹𝑜𝑢𝑡𝑙𝑖𝑒𝑟 as per the equation (4):

𝐷𝑓𝑖𝑙𝑡𝑒𝑟𝑒𝑑(𝑡) = 𝐷𝑟𝑎𝑤(𝑡) −𝐹𝑜𝑢𝑡𝑙𝑖𝑒𝑟(𝐷𝑟𝑎𝑤(𝑡))                                        (4)

Where, 𝐷𝑓𝑖𝑙𝑡𝑒𝑟𝑒𝑑(𝑡) is the filtered sensor data at time 𝑡, 𝐷𝑟𝑎𝑤(𝑡) is the raw sensor data before noise reduction, 𝐹𝑜𝑢𝑡𝑙𝑖𝑒𝑟(𝐷𝑟𝑎𝑤(𝑡)) is the outlier function that identifies and removes noisy or inconsistent data by applying machine learning-based filtering methods such as statistical thresholds, deep learning-based denoising. The ISLMF dynamically adjusts the sensor thresholds after analysis based on its history of livestock patterns and environmental conditions. The following is the computation of the time 𝑡 threshold as per the equation (5):

𝑇𝑠(𝑡) = 𝜇𝑠+ 𝛼∙𝜎𝑠+ 𝛽∙𝐸(𝑡)                                                   (5)

Where, 𝑇𝑠(𝑡) is the dynamic threshold for sensor 𝑠 at time 𝑡, 𝜇𝑠 is the historical mean value of the sensor data, 𝜎𝑠 is the historical standard deviation of the sensor data, 𝐸(𝑡) environmental factors, e.g., temperature, humidity, etc. of time 𝑡, 𝛼 and 𝛽 are adaptive coefficients deciding the effect of fluctuations and environmental conditions on the threshold. The optimal health status or anomaly score is 𝐴(𝑡) computed through integration of filtered sensor data, dynamically changed thresholds, and the anomaly detection function 𝐹𝑎𝑛𝑜𝑚 as per the equation (6):

𝐴(𝑡) = ∑ 𝑤𝑖(𝑡) ∙𝐹𝑎𝑛𝑜𝑚(𝐷𝑓𝑖𝑙𝑡𝑒𝑟𝑒𝑑,𝑖(𝑡), 𝑇𝑠,𝑖(𝑡)) 𝑁 𝑖=1 (6)

Where, 𝐴(𝑡) be the total anomaly score or health status at time 𝑡, 𝑁 denotes the number of sensors, 𝑤𝑖(𝑡) represents the weight for each sensor given by the reliability, 𝐹𝑎𝑛𝑜𝑚(𝐷𝑓𝑖𝑙𝑡𝑒𝑟𝑒𝑑,𝑖(𝑡), 𝑇𝑠,𝑖(𝑡)) is an outlier detection function that raises alarms beyond the dynamic threshold 𝑇𝑠,𝑖(𝑡).

These equations describe how all three work in unison in ISLMF-AI to improve animal health monitoring and anomaly detection efficiency with high precision, consistency in the data, and reliable automated decision-making.

3.1.3 Real-Time Anomaly Detection

Real-Time Anomaly Detection continuously monitors livestock health and identifies any abnormal changes such as sudden temperature spikes, irregular feeding behaviour, or unusual movement patterns. Early indication of such anomalies leads to prompt interventions through ISLMF, which reduce livestock morbidity and avoid outbreak situations. Furthermore, it is integrated with automation feeding and watering systems that provide the appropriate nutritionally balanced feed, hygienic water supply, and hydration tailored to the health profile of each animal for maximum overall well-being and productivity. To detect health anomalies in animals, a real-time anomaly score 𝐴(𝑡) is calculated through the analysis of deviations in vital health parameters (such as temperature, feeding, and movement) from their respective expected values as per the equation (7):

|𝐷𝑖(𝑡)−𝜇𝑖| 𝑀 𝑖=1 (7) 𝐴(𝑡) = ∑ 𝜎𝑖

Where, 𝐴(𝑡) represents the overall anomaly score at time 𝑡, 𝑀 is the count of monitored parameters, such as temperature, feeding, and movement, 𝐷𝑖(𝑡) is the real-time value of parameter 𝑖, 𝜇𝑖 is the mean, and 𝜎𝑖 is the standard deviation the historical mean and standard deviation of parameter 𝑖. If 𝐴(𝑡) exceeds a predefined threshold 𝑇𝐴, an anomaly alert is issued, that triggers intervention. Once the anomaly is found, the system adjusts the feed and water supply based on the health profile of the livestock automatically as per the equation (8):

𝐹𝑎𝑑𝑗(𝑡) = 𝐹𝑏𝑎𝑠𝑒+ 𝛾∙𝐴(𝑡)                                                      (8)

Where, 𝐹𝑎𝑑𝑗(𝑡) is the feed/water amount adjusted at time 𝑡, 𝐹𝑏𝑎𝑠𝑒 is the base nutritional intake of the animal profile, 𝛾 is a scale factor that represents how much the anomaly score 𝐴(𝑡) should impact the adjustment. Hydration is self-regulated by an animal depending on the hydration status of an animal and the temperature of the environment to avoid dehydration as per the equation (9):

𝑊𝑎𝑑𝑗(𝑡) = 𝑊𝑏𝑎𝑠𝑒+ 𝛿∙(𝑇𝑒𝑛𝑣(𝑡) −𝑇𝑜𝑝𝑡) + 𝜂∙𝐻𝑑𝑒𝑓(𝑡)                               (9)

Where, 𝑊𝑎𝑑𝑗(𝑡) is the adjusted water supply at time 𝑡, 𝑊𝑏𝑎𝑠𝑒 is the baseline water requirement, 𝑇𝑒𝑛𝑣(𝑡) is the current environmental temperature, 𝑇𝑜𝑝𝑡 is the optimal temperature for livestock well-being, 𝐻𝑑𝑒𝑓(𝑡) is the detected hydration deficiency, 𝛿 and 𝜂 are weight factors controlling temperature and hydration adjustments.

ISLMF, therefore, enhances the accuracy, reliability, and efficiency of IoT-based livestock monitoring by combining adaptive sensor fusion, AI-driven filtering, and real-time anomaly detection. This will improve disease prediction and preventive care while optimizing feeding strategies, reducing manual labour, and ensuring a sustainable, data-driven approach to precision livestock farming.

3.2 Federated Learning for Secure and Adaptive Model Training

In smart livestock farming, AI-driven insights are key to disease detection, anomaly prediction, and decisionmaking. Traditional cloud-based AI models, however, require central data storage and thus raise the risk of privacy breaches, security vulnerabilities, and high communication overhead. To overcome all the above barriers, this work develops the new concept of introducing a Privacy Preserving Hybrid Aggregation (PPHA) Algorithm as the combination of Secure Multi-Party Computation (SMPC) that conducts computation on farms' data and doesn't compromise with the anonymity of individual farmers, and Differential Privacy Mechanism which adds controlled random noise to sensitive data, preventing unauthorized access while preserving the accuracy of models. This study makes use of Federated Learning, a decentralized AI training approach in which raw data stays on the local IoT devices. This means that multiple farms can train models without sharing sensitive data. The approach ensures privacy, security, and scalability in real-time livestock monitoring. It improved the model's resilience towards data leakages and cyber-attacks as well as dynamic aggregation, where model weights change with circumstances in a farm and the quality of the received data. These make for fewer overhead communications, enhancing the model in real-time processing. Figure 3 displays the architecture of the proposed PPHA Algorithm.

Figure 3. Architecture of the proposed PPHA Algorithm
Figure 3. Architecture of the proposed PPHA Algorithm

3.2.1 Secure Multi-Party Computation (SMPC)

SMPC is a technique of cryptography that allows parties to jointly compute a function over their combined data without revealing their individual inputs. In the agriculture context, this will ensure that sensitive farm data, including crop yields and soil conditions or health information for livestock, does not leak out. All participants privately hold their data, and with SMPC protocols, it computes the results like predictions or analytics together while ensuring no participant learns anything about the other person's data. This ensures that data privacy and integrity are maintained without missing collaborative analysis for better decision making in farm management. In SMPC, several participants (𝑃1, 𝑃2, … , 𝑃𝑁) possess private data (𝑥1, 𝑥2, … , 𝑥𝑁) and cooperatively compute a function 𝑓(𝑥1, 𝑥2, … , 𝑥𝑁) without revealing individual inputs as per the equation (10):

𝑦= 𝑓(𝑥1, 𝑥2, … , 𝑥𝑁)                                                          (10)

Where, 𝑦 is the outcome of the computation (e.g., forecast for livestock health patterns, crop yield prediction), 𝑥𝑖 is the data that belongs to participant 𝑃𝑖, 𝑓 is an aggregation or processing function that does not reveal 𝑥𝑖. Divide every private data, 𝑥𝑖 into different shares, 𝑠𝑖𝑗 distributed to other users so that any single user will not be able to reconstruct it as per the equation (11):

𝑥𝑖= ∑ 𝑠𝑖𝑗 𝑁 𝑗=1 𝑚𝑜𝑑 𝑝                                                             (11)

Where, 𝑠𝑖𝑗 is share of data 𝑥𝑖 sent to participant 𝑃𝑗, is a large prime number so 𝑝 is used here to ensure secrecy in modular arithmetic. Instead of sending the data directly, each participant executes partial computations on their secret shares and sends the results to a central aggregator that reconstructs the final output as per the equation (12):

𝐹(𝑥1, 𝑥2, … , 𝑥𝑁) = ∑ 𝑓(𝑠𝑖1, 𝑠𝑖2, … , 𝑠𝑖𝑁) 𝑁 𝑖=1 𝑚𝑜𝑑 𝑝                                  (12)

Where, 𝐹(𝑥1, 𝑥2, … , 𝑥𝑁) is the final aggregated result; 𝑓(𝑠𝑖1, 𝑠𝑖2, … , 𝑠𝑖𝑁) denotes the local computation at each participants using secret shares.

3.2.2 Differential Privacy Mechanism

Differential Privacy is a technique to preserve the privacy of individual data while enabling meaningful analysis. It does this by adding noise in a way that is calibrated carefully to sensitive data before processing it so that no result or analysis leaks information about any participant. This mechanism ensures that including or excluding one data point not change the outcome significantly, hence preventing unauthorized access or inference of private information. In doing this, differential privacy balances the issues of data privacy and model accuracy, hence, allowing for sensitive data usage for machine learning and analytics in an application not sacrificing individual confidentiality in applications, which are inherently sensitive to privacy like healthcare and agriculture. To achieve privacy, differential privacy adds a certain degree of noise to the output of a function. The Laplace mechanism makes a perturbation of the output 𝑓(𝐷) of a function 𝑓 applied to a dataset 𝐷. This adds noise sampled from the Laplace distribution as per the equation (13):

𝑓̃(𝐷) = 𝑓(𝐷) + 𝐿𝑎𝑝(𝜆)                                                       (13)

Where, 𝑓̃(𝐷) is the answer with differential privacy, 𝑓(𝐷) is the original function output (for example, the average health score of livestock), 𝐿𝑎𝑝(𝜆) denotes Laplace noise with a scale parameter 𝜆, for privacy protection. The magnitude of the noise introduced depends on the sensitivity of the objective function, which is the measure of the effect of one observation on the function output as per the equation (14):

∀𝐷,𝐷′||𝑓(𝐷) −𝑓(𝐷′)||                                                      (14) ∆𝑓= max

Where, 𝛥𝑓, is the sensitivity of function 𝑓, 𝐷 and 𝐷′ two datasets differ by one observation, ||𝑓(𝐷) −𝑓(𝐷′)|| is the maximum function output change when one observation is added or removed. Differential Privacy ensures that the chances of a certain result emerging is the same whether a particular data point is included or not. It is mathematically expressed in the equation (15):

𝑃[𝑓̃(𝐷)] 𝑃[𝑓̃(𝐷′)] ≤𝑒𝜀                                                                 (15)

Where, 𝑃[𝑓̃(𝐷)] and 𝑃[𝑓̃(𝐷′)] are the chances of producing the same noisy output for datasets D and D′ (differing by one record); ∈ (epsilon) is the privacy budget that balances the trade-off between privacy and accuracy.

This PPHA framework lets distributed farms benefit the particular illumination in disease detection and anomaly prediction with AI without leaking personal data, thus fostering trust, efficiency, and resilience in AI-powered livestock management.

3.3 Digital Twin for Predictive Analytics and Decision-Making for Livestock Management

In a word, DT technology provides the construction of a dynamic virtual replica of the real livestock environment. By integrating sensors and environmental data with the livestock's parameters, it provides accurate, real-time models of the farm and offers insights into different aspects such as disease progression, climatic changes, and allocation of resources.

In terms of novelty, the Digital Twin-Augmented Reinforcement Learning (DTARL), enhances the DT framework through the incorporation of reinforcement learning (RL). By incorporating RL into the DT framework, it is able to replicate the environment but continuously learn and improve the decision-making strategy. Using both historical and real-time data, the DTARL system simulate diverse conditions of the farm and test a variety of management strategies. This capability allows it to predict optimum intervention strategies such as changing feeds or medications, environmental conditions for least risk from the disease. The proposed architecture of the model DTARL is displayed in the Figure 4.

Figure 4. Architecture of the proposed DTARL
Figure 4. Architecture of the proposed DTARL

The RL model in DTARL learns to cope with various scenarios: simulating disease outbreak, climatic fluctuations, and nutritional variations. Learning constantly is how it predicts the most effective responses at real-time so proactive management is done. Additionally, FL integration enhances its learning efficiency as well as adaptability. By simulating various conditions and refining it in a virtual environment before its actual deployment on the farm, DTARL minimizes risks and ensures that the livestock management system is robust and responsive to changing environments. It optimizes well-being of livestock, reduces operational costs, and does support sustainable farming practice.

3.4 Addressing Key Challenges

The proposed methodology bridges critical limitations found in existing smart livestock solutions.

Data privacy: FL prevents data leaks and cyber threats by having the PPHA algorithm centrally centralized.

Handling of Non-IID data: The FL adaptive model aggregation takes care of heterogeneous data coming from various farms.  Scalability: DT simulations enable fast testing and deployment of AI models.  Computational efficiency: Optimized edge-computing techniques reduce the burden of realtime processing. 3.5 Implementation and Expected Outcomes

This is deployed on low-power IoT devices integrated with cloud–edge computing for efficiency.

 Experimental validation of the proposed framework FL-DT is compared against traditional centralized approaches in terms of accuracy, latency, and adaptability.  Improvements Expected:  Higher disease prediction accuracy due to adaptive learning offered by DTARL.  Optimized sensor fusion for efficient use of resources.  Reduced operational costs through elimination of unnecessary interventions and improvement of automation.

The proposed PEDLO framework introduces the concept of ISLMF for data collection, PPHA for model aggregation, and DTARL for adaptive decision-making, hence ensuring a scalable, autonomous, and resilient agricultural ecosystem.

Thus, the proposed methodology harnesses FL technology into DT and is integrated within a smart IoT livestock framework that promotes agricultural productivity, sustainability, and autonomous decision-making. The paradigm ensures real-time health monitoring/predictive analytics/adaptive intervention while considering data privacy, computational efficiency, and model scalability. Let's introduce the PEDLO system, where ISLMF shows an adaptive multi-sensor fusion model assuring accurate livestock health tracking. A novel PPHA scheme combines again SMPC and Differential Privacy to improve the security of FL-based AI training. In this way, the DTARL has become AI-based predictive modelling that learns optimal strategies for livestock management from real-time simulation. The innovations, thus, assumed together enhance animal welfare, optimize resource utilization, and support secure data sharing in smart livestock environments, providing an impetus to scalable, cost-effective automated precision farming solutions. The performance evaluation of the proposed model is explained in next section.

4. Results and Discussion

The experimental results indicate the successful feasibility of the proposed PEDLO system in smart livestock farming. Important performance metrics were evaluated for the developed system compared with other state-ofthe-art models such as FedTDLR [16], BAFT-SVM [18], CGAN-HHO [19] and CNN-TN [25] in terms of accuracy, FPR, computational overhead, energy consumption, and model convergence time. These results exhibit an excellent level of predictive accuracy, anomaly detection sensitivity, and data privacy preservation in real-time livestock monitoring and decision-making by a robust federated learning-integrated digital twin framework.

4.1 Experimental Setup Tools Used: Python (to implement, to simulate, and to evaluate its performance).  Hardware Environment: A high-performance computing setup with the acceleration of GPUs.  Deployment: Edge-cloud integration for real-time processing and analysis.  Visualization and Analysis: The results are presented graphically through Python-based libraries such as Matplotlib and Seaborn.

Figure 5. Accuracy of the proposed model
Figure 5. Accuracy of the proposed model

The accuracy of the proposed model compared with the other existing techniques like FedTDLR, BAFT-SVM, CGAN-HHO and CNN-TN are displayed in the Figure 5. The accuracy of the proposed model is 0.94, whereas the accuracy of the FedTDLR, BAFT-SVM, CGAN-HHO and CNN-TN are 0.87, 0.90, 0.82 and 0.88, respectively. There is a significant improvement in the proposed model. This model will thus enhance accuracy, federated through learning at 0.9, decentralized data analysis, digital twins, and real-time simulations. IoT enhanced smart livestock by allowing continuous health monitoring, resource optimization, and collaborative learning while preserving data privacy, hence driving sustainable, scalable agricultural innovations.

Figure 6. FPR of the proposed model
Figure 6. FPR of the proposed model

Figure 6 shows the comparison of FPR for the proposed method with the current methods like FedTDLR, BAFTSVM, CGAN-HHO, and CNN-TN. FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN have FPR values of 0.10, 0.085, 0.13, and 0.105, respectively. The proposed model has an FPR of 0.05. It is a considerable improvement. The proposed model helps minimize the false positive rate by integrating federated learning with digital twin technology, thereby facilitating precise, collaborative data analysis without regard to privacy. The second contribution of advanced IoT pertains to agricultural production, wherein real-time monitoring and decision-making enable highly efficient and intelligent smart livestock environments.

Figure 7. Model Convergence Time of the proposed model
Figure 7. Model Convergence Time of the proposed model

The Model Convergence Time of the proposed method against the existing approaches like FedTDLR, BAFTSVM, CGAN-HHO, and CNN-TN, are presented in Figure 7. FedTDLR, BAFT-SVM, CGAN-HHO, and CNNTN have Model Convergence Times of 60, 50, 90, and 70 seconds, respectively. The Model Convergence Time in the proposed model is 40 seconds. It's a significant improvement. The proposed model is optimized for federated learning algorithms, reducing the convergence time for faster model updates and minimizing the communication overhead.

Figure 8. Computational Overhead of the proposed model
Figure 8. Computational Overhead of the proposed model

Figure 8 illustrates the computational overhead of the proposed technique against current methods, like FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN. Computational overheads of FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN are 5.25 GFLOPs, 4.25 GFLOPs, 8.25 GFLOPs, and 6.25 GFLOPs, respectively. The computational overhead of the proposed approach is 3.25 GFLOPs. This is a tremendous improvement. The proposed model reduces computational overhead by processing data locally on IoT devices using federated learning, thus minimizing the need for centralized computing. Advanced IoT contributions enable real-time data collection for digital twins, enhancing smart livestock environments through precise monitoring, predictive analytics, and efficient resource management in agricultural production.

Figure 9. Energy consumption of the proposed model
Figure 9. Energy consumption of the proposed model

Figure 9 depicts the comparison of the proposed method's energy consumptions with that of some available techniques including FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN. The FedTDLR, BAFT-SVM, CGANHHO, and CNN-TN have different consumptions that is 2.85 W-h/device, 2.4 W-h/device, 4 W-h/device, and 2.6 W-h/device, respectively. The energy consumed by the proposed method for a device is 1.85 W-h. This is enormous. The proposed model therefore reduces energy consumption through federated learning by the processing of local data on the IoT devices thereby reducing data transmissions and the demand for central processing. The modern contributions of the IoT combined with digital twin transform agricultural production; the livestock smart environment is thereby efficient, smart, and environmentally friendly.

Figure 10. Data Privacy Preservation of the proposed model
Figure 10. Data Privacy Preservation of the proposed model

Figure 10 compares the Data Privacy Preservation of the proposed method with that of a few existing methods, namely FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN. The Data Privacy Preservation scores for FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN are 0.75, 0.80, 0.65, and 0.83, respectively. The data privacy preservation score of the proposed method for a device is 0.92. This is huge. Data privacy will be maintained by the proposed model through federated learning, which keeps raw data safe on the IoT devices like vaults guarding secrets. Advanced IoT and digital twins are transforming agriculture by building smart livestock environments with real-time insights into amplified efficiency.

Figure 11. Anomaly detection sensitivity of the proposed model
Figure 11. Anomaly detection sensitivity of the proposed model

Figure 11 compares the anomaly detection sensitivity of the proposed method with a few other approaches, including FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN. FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN have anomaly detection sensitivity ratings of 0.81, 0.84, 0.78, and 0.85, respectively. The proposed method has a sensitivity score of 0.93 for detecting anomalies in a device. This is enormous. By integrating federated learning and digital twin technologies, the proposed model heightens anomaly detection sensitivity, allowing IoT devices to work together like a synchronized network of eagle-eyed detectors spotting deviations with precision. Such an advanced contribution from IoT boosts smart livestock environments, transforming agriculture through sharp monitoring and intelligent insights.

Figure 12. Scalability of the proposed model
Figure 12. Scalability of the proposed model

To comparatively evaluate the proposed method's scalability, a comparison is made here with a couple of alternative approaches, namely, FedTDLR, BAFT-SVM, CGAN-HHO and CNN-TN in Figure 12. Thus, the relative scalability ratings with FedTDLR, BAFT-SVM, CGAN-HHO and CNN-TN are 750 NS, 1150 NS, 650 NS and 1350 NS respectively. Proposed method carries a scalability with 2250 NS. Hugely larger. The proposed model harnesses the federated learning and digital twin technology to scale up the capability by efficiently adding more IoT devices without straining central systems the kind of network that expands effortlessly with each added node. Such an advanced contribution to IoT technology transforms agricultural production through the crafting of smart environments for livestock that offer real-time insights and adaptive management.

Figure 13. Latency in Decision Making of the proposed model
Figure 13. Latency in Decision Making of the proposed model

Figure 13 shows the comparison with a few different approaches FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN to evaluate the Latency in Decision Making of the proposed method. In this regard, FedTDLR, BAFTSVM, CGAN-HHO, and CNN-TN have ratings of Latency in Decision Making as 250 ms, 215 ms, 300 ms, and 230 ms, respectively. The proposed method has a decision-making latency of 140 ms. Much bigger. This way, the proposed model reduces latency by eliminating data transmission delay during processing locally and lets decisions take place in real time. With advanced IoT contributions, coupled with digital twin technology, agricultural production is transformed into smart livestock environments with real-time insights for effective management.

Figure 14. Resource utilization efficiency of the proposed model
Figure 14. Resource utilization efficiency of the proposed model

Figure 14 compares the resource utilization efficiency of the proposed method with a few alternative approaches: FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN. The corresponding resource utilization efficiency ratings for FedTDLR, BAFT-SVM, CGAN-HHO, and CNN-TN are 0.78, 0.81, 0.75, and 0.83. The resource utilization efficiency of the proposed approach is 0.91. Much larger. Advanced contributions of IoT technology, combined with digital twin capability, provide enhanced smart livestock environment that enhances productiveness and sustainable productivity. Fine-tuning such, a machine leads to optimization for resource utilization towards energy efficiency of data transmission within the proposed federated learning for processing data at the local layer.

4.2 Discussion

The experimental results are provided, proving the PEDLO system proposed to be effective for smart livestock management. Compared with the compared state-of-the-art models, such as FedTDLR, BAFT-SVM, CGANHHO, and CNN-TN, it is evident that PEDLO significantly improves accuracy (0.94), sensitivity to anomaly detection (0.93), and protects data privacy (0.92) while having reduced false positives at 0.05, computational overhead at 3.25 GFLOPs, and energy consumption at 1.85 W-h/device. The integration of FL and DT technology enables adaptive real-time learning with efficient decision-making. It achieves a faster model convergence time at 40 seconds and decreased latency at 140 ms. Also, superior scalability at 2250 NS makes the system scale smoothly over the IoT devices. The ability of the PEDLO system to process decentralized data and ensure security using SMPC and Differential Privacy ensures it as an appropriate solution for precision livestock farming. Future improvements include deep learning techniques and hybrid optimization strategies for further scalability and adaptability.

5. Conclusion

This paper introduced the PEDLO System an innovative concept that combines IoT with FL and DT technologies to overcome the main limitations in precision livestock farming. The proposed system with such a variety of technology combination effectively reduces issues with data privacy, heterogeneous data processing, computational overhead, and real-time decision-making capabilities. However, by introducing the ISLMF for adaptive sensor fusion, the PPHA Algorithm for privacy-preserving federated learning, and the DTARL model for AI-driven predictive analytics, PEDLO ensures that the livestock management system be extremely secure, scalable, and autonomous. Experimental validation confirms the superiority of the system with respect to all existing models: 94% accuracy, 0.93 anomaly detection sensitivity, and 92% data privacy preservation and reduced false positives (0.05), computation overhead (3.25 GFLOPs), and energy consumption (1.85 W-h/device). Its convergence time and latency are just 40s and 140ms, respectively, which gives PEDLO sufficient suitability for the dynamic agricultural environments. By exploiting edge-cloud computing, decentralized intelligence, and AI-driven decision-making, PEDLO advances disease prediction, anomaly detection, and resource optimization for livestock, all of which are accomplished in a secure and scalable manner. The proposed system was one of the greatest advances in smart livestock farming toward sustainable, cost-effective, and intelligent agricultural practices. Future work will be aimed at hybrid deep learning techniques and multi-modal optimization strategies to further hone scalability and adaptability in real-world applications.

References

  1. P. Gholami and H. Seferoglu, “Digest: Fast and communication efficient decentralized learning with local updates,” IEEE Trans. Mach. Learn. Commun. Netw, 2024.
  2. R. González-Herbón, G. González-Mateos, J. R. Rodríguez-Ossorio, M. Domínguez, S. Alonso, and J. J. Fuertes, “An approach to develop digital twins in industry,” Sensors, vol. 24, no. 3, p. 998, 2024.
  3. M. H. Islam, M. Z. Anam, M. R. Hoque, M. Nishat, and A. M. Bari, “Agriculture 4.0 adoption challenges in the emerging economies: Implications for smart farming and sustainability,” J. Econ. Technol., vol. 2, pp. 278–295, 2024.
  4. P. B. Bök and D. Micucci, “The future of human and animal digital health platforms,” J. Rel. Intell. Environ., vol. 10, no. 3, pp. 245–256, 2024.
  5. S. Nyamuryekung'e, “Transforming ranching: Precision livestock management in the Internet of Things era,” Rangelands, vol. 46, no. 1, pp. 13–22, 2024.
  6. J. E. Sierra-Garcia and M. Santos, “Federated discrete reinforcement learning for automatic guided vehicle control,” Future Gener. Comput. Syst., vol. 150, pp. 78–89, 2024.
  7. S. Ji et al., “Emerging trends in federated learning: From model fusion to federated x learning,” Int. J. Mach. Learn. Cybern., pp. 1–22, 2024.
  8. M. Ficco et al., “Federated learning for IoT devices: Enhancing TinyML with on-board training,” Inf. Fusion, vol. 104, p. 102189, 2024.
  9. H. Wahab, I. Mehmood, H. Ugail, J. Del Ser, and K. Muhammad, “Federated deep learning for wireless capsule endoscopy analysis: Enabling collaboration across multiple data centers for robust learning of diverse pathologies,” Future Gener. Comput. Syst., vol. 152, pp. 361–371, 2024.
  10. A. Alshammari and K. El Hindi, “Privacy-preserving deep learning framework based on restricted Boltzmann machines and instance reduction algorithms,” Appl. Sci., vol. 14, no. 3, p. 1224, 2024.
  11. K. R. Žalik and M. Žalik, “A review of federated learning in agriculture,” Sensors, vol. 23, no. 23, p. 9566, 2023.
  12. Y. Jiang, W. Wang, J. Ding, X. Lu, and Y. Jing, “Leveraging digital twin technology for enhanced cybersecurity in cyber–physical production systems,” Future Internet, vol. 16, no. 4, p. 134, 2024.
  13. M. Verdugo-Cedeño et al., “Simulation-based digital twins enabling smart services for machine operations: An industry 5.0 approach,” Int. J. Hum.–Comput. Interact., vol. 40, no. 20, pp. 6327–6343, 2024.
  14. H. Cai, J. Wan, and B. Chen, “Digital twin-driven multi-factor production capacity prediction for discrete manufacturing workshop,” Appl. Sci., vol. 14, no. 7, p. 3119, 2024.
  15. S. Cesco et al., “Smart agriculture and digital twins: Applications and challenges in a vision of sustainability,” Eur. J. Agron., vol. 146, p. 126809, 2023.
  16. L. Praharaj, D. Gupta, and M. Gupta, “Efficient federated transfer learning-based network anomaly detection for cooperative smart farming infrastructure,” Smart Agric. Technol., vol. 10, p. 100727, 2025.
  17. H. Devaraj et al., “RuralAI in tomato farming: Integrated sensor system, distributed computing and hierarchical federated learning for crop health monitoring,” IEEE Sens. Lett., 2024.
  18. R. Shen et al., “BAFL-SVM: A blockchain-assisted federated learning-driven SVM framework for smart agriculture,” High-Confidence Comput., vol. 5, no. 1, p. 100243, 2025.
  19. A. Sayed, S. Alshathri, and E. E. D. Hemdan, “Conditional generative adversarial networks with optimized machine learning for fault detection of triplex pump in industrial digital twin,” Processes, vol. 12, no. 11, p. 2357, 2024.
  20. Y. Kalyani, L. Vorster, R. Whetton, and R. Collier, “Application scenarios of digital twins for smart crop farming through cloud–fog–edge infrastructure,” Future Internet, vol. 16, no. 3, p. 100, 2024.
  21. V. Medennikov, “Digital twin of livestock production in unified digital platform of Russian agriculture management,” in BIO Web Conf., vol. 116, p. 02012, 2024.
  22. A. Youssef et al., “IUMENTA: A generic framework for animal digital twins within the Open Digital Twin Platform,” arXiv preprint arXiv: 2411.10466, 2024.
  23. A. Barbie, W. Hasselbring, and M. Hansen, “Digital twin prototypes for supporting automated integration testing of smart farming applications,” Symmetry, vol. 16, no. 2, p. 221, 2024.
  24. L. Praharaj, M. Gupta, and D. Gupta, “Hierarchical federated transfer learning and digital twin enhanced secure cooperative smart farming,” in Proc. IEEE Int. Conf. Big Data (BigData), pp. 3304–3313, Dec. 2023.
  25. L. Praharaj, D. Gupta, and M. Gupta, “A lightweight Edge-CNN-Transformer model for detecting coordinated cyber and digital twin attacks in cooperative smart farming,” in Proc. IEEE Int. Conf. Big Data (BigData), pp. 6346–6355, Dec. 2024