COGNIHERD: Monitoring Livestock Health Using Artificial Intelligence (AI) and Internet of Things (IoT)

GurjantSinghAulakh 629 views 56 slides Jul 04, 2024
Slide 1
Slide 1 of 56
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56

About This Presentation

'COGNIHERD' is a groundbreaking system that revolutionizes livestock health monitoring through AI and IoT. In this project I utilized the D1 WiFi module with ESP8266 and Arduino Uno for real-time monitoring, achieving impressive 0.9% accuracy across tasks. Its key features include SVM for vo...


Slide Content

COGNIHERD: MONITORING LIVESTOCK HEALTH USING ARTIFICIAL INTELLIGENCE GURU NANAK DEV UNIVERSITY, AMRITSAR, PUNJAB DEPARTMENT OF AGRICULTURAL SCIENCES Supervised By : Dr. Amandeep Singh (Professor, GNDU) S ubmitted By : Gurjant Singh Course: AI in Agri. Roll no. 37082355104

COGNIHERD: Monitoring livestock health using ai A novel and fully automated approach

Dated: 12 April 2024

Topics to be discussed: Introduction Literature Review Research Methodologies History Existing System Proposed System Why is it needed? Working Principle System Requirements

Cont. 10. Dataset Collection 11. Potential Targeted Diseases 12. Dataflow Architecture 13. Wearable IoT Device 1 4 . Design & Implementation 15 . Results 16 . Future Perspectives 1 7. Conclusion 1 8. References Appendices

Introduction: Cogni = (cognitive ability) Herd = (group of livestock) AI-based livestock health monitoring utilizes machine learning and computer vision to analyze data from various sources like images, sensor data, and sounds to detect signs of illness or stress in animals, enabling early intervention and improved welfare.

Literature Review: Key research methodologies being utilized during the overall findings of this project of Livestock Health Monitoring Using AI were as following: 1. Previous Review Papers : Review papers of various authors were being used for references. 2. Qualitative Data : Quality of the material was also put under the main concern for the project work. 3. Quantitative Data : Little Quantitative data was also employed for better understanding. 4. Statistical Analysis : Statistical finding of real time livestock health monitoring were also presented in this project. 5. Books References : E-books and handbooks were also used for references. 6. Others : Literature revisions , Data evaluation , sorting , Historical Research etc.

Research approaches (Methodologies): A concise summary of the methodology that has been used for this livestock health monitoring project using Al includes the following: 1. Data Collection and Preprocessing : Gather sensor data from livestock , cleaned, and normalized. For training dataset sites like Mendely , Kaggal , GitLab , and Roboflow were used. 2. Model Selection: AI models for Prediction used CNN , SVM , ResNet152V2. 3. Training and Validation: Training of models , validation with testing data using metrics like accuracy and F1-score . 4. Integration and Deployment: Integration of models into the monitoring system, deploy for real-time use. 5. Feedback and Improvement: Collect feedback, retrain models periodically for better performance.

Back in time: The history of monitoring livestock health using AI began in the early 2000s with basic machine learning techniques applied to sensor data. By the 2010s , advancements in computer vision led to more sophisticated analysis of images and videos. Today, AI-driven systems are widely integrated into livestock management practices, offering real-time insights for better productivity and animal welfare.

Existing system: For earlier year, dairy farm and farmers used the special technique for detection of animal health related diseases and it require The continuous or daily to daily base observation which again require the excessive labour if we consider the dairy farm cattle’s Health monitoring. Sometime such technique gives the wrong result which was different from the actual health status of cattle‘s. This can cause the harmful effect on the cattle health. There is no such system developed to predict the diseases of cattle in the Initial stage and provide treatment to the cattle on time. So there must be the proposed automatic health monitoring system which Keeps the record health parameter fast and accurate so that proper treatment use.

Gaps: Existing system of livestock health monitoring have numerous limitations /gaps that can be described as following:
1. Manual monitoring is time-consuming and prone to errors. 2. Limited data analysis misses crucial indicators .
3. Subjectivity leads to variations in diagnosis. 4. Challenges in real-time monitoring and scalability. 5. Lack of predictive analytics and data integration.
6. Higher costs and inefficiencies in traditional methods.

Proposed System: In the proposed system, it provides machine learning & CNN algorithms for effective prediction of various disease occurrences in disease-Frequent societies. It experiment the altered estimate models over real-life cattle health data collected. To overcome the difficulty Of incomplete data, it use a latent factor model to rebuild the missing data. Machine learning is a sub field of artificial intelligence Which allows forecasting through learning past behaviours and rules from old data. In Cattle health, although machine learning is generally preferred particularly in predicting diseases and identifying respective risk Factors , it is obvious that there are a limited number of publications where this method was applied on veterinary or indicates Whether it is correct and applicable. CNN, SVM, and Resnet152V2 algorithms are used to predict the cattle health condition.

Objective: The objective of this project on livestock health monitoring using AI is to enhance livestock management through:
1. Early detection of health issues.
2. Continuous real-time monitoring of vital parameters.
3. Predictive analytics for risk assessment. 4. Data-driven decision support. 5. Automation of monitoring tasks.

Why it was needed? AI is needed to monitor livestock health because it offers several advantages over existing methods: Early Detection Continuous Monitoring Accuracy & Objectivity Scalability Predictive Analytics Cost Effectiveness

Working principle ( IoT ): IoT , or the Internet of Things , refers to the network of interconnected devices that can communicate and share data with each other over the internet , enabling them to collect , exchange , and act upon information without human intervention. 1. Perception Layer : Sensors and actuators gather data from the physical world. 2. Network Layer : Facilitates communication between devices and centralized servers using various protocols like Wi-Fi, Bluetooth, etc. 3. Application Layer : Processes and analyzes data collected from sensors, often using cloud-based services and data analytics platforms. Optional: 4. Edge Computing Layer : Performs data processing closer to the source, reducing latency and bandwidth usage.

System Requirements: HARDWARE REQUIREMENT Arduino Esp8266 Internet connection hotspot is mandatory Sensors Jump Wires Patch Chords Laptop Mobile phone

System Requirements cont. SOFTWARE REQUIREMENTS: a. My SQL Server b. Software development IDE c. Asp dot net d. Visual studio

Dataset collection: To train my models for bovine health predictions against various diseases, I have gathered datasets from different sites like., Mendeley , GitLab , Roboflow , Kaggle . The specific datasets I found from these sites are mention below:
1. Bovine milk datasets from Mendeley for bovine mastitis detection.
2. Bovine talk dataset from GitLab for vocalization analysis. 3. Bovine fecal matter dataset from Roboflow for digestive health monitoring.
4. Mixed bovine disease prediction datasets from Kaggle for comprehensive health analysis.

Dataset COLLECTION CONT. https://data.mendeley.com/datasets/kbvcdw5b4m/2 https://gitlab.com/is-annazam/bovinetalk

Dataset collection CONT. https://universe.roboflow.com/search?q=class:fecal%20matter https://www.kaggle.com/datasets/khushupadhyay/cow-health-prediction

Dataset collection CONt. Healthy bovine milk Unhealthy bovine milk

Dataset collection CONT. Healthy bovine talk Unhealthy bovine talk

Dataset collection CONT. Healthy bovine excreta Unhealthy bovine excreta

Dataset collection CONT.

AI-Based Animal welfare and disease Monitoring:

Data flow Diagram for livestock health monitoring:

Cont. Data Flow diagram of cattle health monitoring System , where the data from sensors is collected and Analyzed . We use four main sensors ie .., temperature sensor , accelerometer sensor, camera sensor and microphone sensor. Temperature sensor Senses the temperature of the cattle , Accelerometer sensor senses the neck movement of cattle and microphone sensor senses the Intensity of sound. These data are sent to the cloud using wi-fi module ESP8266. In cloud the data is analyzed and using prediction Model like CNN, SVM, ResNet152V2 . we predict the changes in cattle health. If there is any variation in cattle health the notification is sent to the caretaker and veterinary doctor.

Wearable devices for livestock health monitoring: Wearable IoT Device a kind of portable integrated system of previous assembled hard and softwares for real time continous llivestock health monitoring with these benefits: Real-time monitoring of vital parameters Data collection and cloud connectivity AI analysis for anomaly detection & Predictive analytics for health issues Alerts and notifications for timely intervention Decision support for informed management Scalability and integration with farm systems Remote access for monitoring convenience

Design and Implementation: This livestock health monitoring project for detection of various diseases in bovine follows the steps that are mentioned below in sequence from collection of data till predictive results. 1. Collect and preprocess sensor data. 2. Choose and train AI models (e.g., CNN , SVM , ResNet152V2 ).
3. Validation and evaluation of model performance. 4. Implementation of real-time monitoring and notification. 5. Integrate with cloud services for scalability. 6. Develop a user-friendly interface, like GUI. 7. Continuously update and improve models.

Monitoring livestock temperature By following these steps, we can effectively monitor livestock temperature using the D1 WiFi module , DS18B20 sensor , and MQTT protocol , enabling real-time data collection and analysis. 1. Connect DS18B20 sensor to D1 WiFi module and power up.
2. Program D1 module using Arduino IDE with MQTT and sensor libraries. 3. Set up MQTT broker and obtain credentials. 4. Code D1 to read sensor data and publish to MQTT broker at intervals.
5. Test setup by monitoring MQTT topic for temperature data.
6. Ensuring MQTT security with SSL and authentication mechanisms.

Monitoring bovine Excreta For the better monitoring of bovine health bovine faecal identification for disease recognition using a ResNet152V2 model is used for vocalisation recognition.
1. Collect and preprocess bovine fecal images. 2. Choose and train a ResNet152V2 model for disease classification. 3. Validate and fine-tune the model for accuracy. 4. Test its performance on a separate dataset.
5. Deploy the ResNet152V2 model for real-time disease recognition in bovine fecal samples.

Faecal Dataset Refining/ Spliting :! Dataset Refining and splitting typically involves: Data Preparation: Ensure your dataset has features and labels. Splitting Process: Shuffle and split into training , validation , and testing sets. Python Example: Use scikit-learn’s train_test_split function. Validation and Testing: Train on the training set , tune on validation , and evaluate on the testing set.

Code ExplaNation : It imports necessary libraries for machine learning , GUI development , and image processing. Defines data directories , model parameters, and data augmentation settings. Sets up image data generators for preprocessing and augmentation . Loads a pre-trained ResNet152V2 model and adds a custom classification head. Compiles and trains the model using training and validation data.

Code ExplaNation cont. 6. Evaluates the model’s performance on test data and visualizes a confusion matrix. 7. Implements a Tkinter GUI with buttons and labels for image upload, display, and prediction. 8. Connects GUI elements to functions for image handling and prediction. 9. Runs the GUI event loop for user interaction and image classification.

Monitoring Bovine Talk For monitoring bovine health conditions bovine voice can be used as a parameter distinguishing between the healthy and unhealthy. 1. Collection of bovine vocalization datasets (healthy and diseased).
2. Preprocessing of audio data ( cleaning , feature extraction , normalization ).
3. Training of SVM classifier. 4. Evaluation of performance (accuracy, precision, recall, F1-score). 5. Validation using cross-validation.
6. Deploy for disease recognition in real-time or batch processing.

Code ExplaNation : Imports libraries for audio processing , machine learning, and evaluation metrics. Defines a feature extraction function ( extract_features ) using librosa for spectral centroid extraction. Sets data paths and initializes lists for features and labels using os and numpy . Processes audio files, extracts features, and converts data to numpy arrays. Splits data into training and testing sets using train_test_split from scikit -learn. Initializes and trains an SVM classifier (SVC) with a linear kernel for classification. Makes predictions on the testing set using the trained SVM model. Calculates the model's accuracy using accuracy_score and generates a classification report using classification_report . Prints the accuracy and detailed classification report.

Monitoring Bovine Mastitis For monitoring bovine health conditions against bovine mastitis bovine milk datasets can be used as a parameter distinguishing between the healthy and unhealthy. 1. Collect and preprocess bovine mastitis images. 2. Design and train a CNN model for mastitis detection.
3. Validate and fine-tune the model for accuracy.
4. Test the model’s performance on a separate dataset.
5. Deploy the CNN model for real-time mastitis recognition in bovine milk/ udder images.

Code ExplaNation : Libraries : Import TensorFlow , Keras , Tkinter , PIL , NumPy , and Matplotlib . Parameters: Define image dimensions , batch size , and epochs for training. Image Handling: Load and preprocess images for prediction. Data Preprocessing: Generate training and validation data for CNN models. CNN Model Creation: Define CNN models for predicting health status and severity level. Compile and train models using training data. Training Visualization: Plot accuracy and loss curves during model training. GUI Elements: Create labels and buttons for user interaction. Tkinter Event Loop: Run Tkinter event loop for GUI functionality.

Results & Discussion: Healthy bovine talk Unhealthy bovine talk

Results & Discussion cont. Healthy bovine excreta Unhealthy Bovine excreta

Results & Discussion cont. Healthy bovine milk Unhealthy Bovine milk

Results & Discussion cont.

Results & Discussion cont.

Results & Discussion cont.

Future perspective: The future of livestock monitoring using AI holds great promise. AI can enhance efficiency by automating tasks like health monitoring, behavior analysis, and predictive maintenance. This technology can provide real-time insights, improving overall animal welfare and farm management. Additionally, AI-driven data analytics can contribute to sustainable practices and precision agriculture, ensuring better resource utilization and minimizing environmental impact.

Conclusion: The proposed project which has been developed is a IOT and ML oriented project which is first of its kind that is implemented for Cattle Health Monitoring System. The project involves prediction and analysis of Cattle Health condition based on records. This project have three objectives which involves the early prediction of the cattle diseases. The First objective is real time monitoring the cattle Body temperature , cattle visualization and sound variations using Sensors. The Second objective is to store the sensor values through Node MCU and send notification to farmers using android smart phone. The Third objective, for prediction and analysis of cattle Diseases using SVM , CNN, and Resnet152V2 algorithms.

References: 1.Fujitsu 2011. A jog trot system. http://www.fujitsu.com/kr/sustainability/agriculrure . 2.Hwang, J. H., Lee, M. H., Ju , H. D., Kang, H. J. & Yoe , H.2010. Implementation of swinery integrated management system in Ubiquitous agricultural environments.The Journal of Korea Information and Communications Society 35(2B): 252–262. 3.Hwang, J. H., Shin, C. S. & Yoe , H. 2010. Study on an agricultural environment monitoring server system using Wireless Sensor networks. Sensors (Basel) 10(12):11189–11211. 4.Kevin Smith (2006) 28th IEEE EMBS Annual International Con- ference , New York City, USA, 4659 – 4662. 5.Ze Li, Haiying Shen and Baha Alsaify (2008) 14th IEEE Inter-national Conference on Parallel and Distributed Systems, 639-646. 6.James D. Meindl (2005) IEEE International Electron Devices Meeting, 23, 1A-1D.

Appendices: code snippets

Thank you! GURJANT SINGH