0% found this document useful (0 votes)
44 views14 pages

Schemos - Smart Cow Health Monitoring System: An Iot Based Cow Hoof Detection and Healthcare Alert System by Using LSTM Network

The document presents the Smart Cow Health Monitoring System (ScHeMoS), an IoT-based solution utilizing Long Short Term Memory (LSTM) networks to monitor cow health, specifically focusing on lameness detection. By collecting data from various IoT sensors, the system achieved an accuracy of 92.45% in identifying health issues in cows, which is critical for improving dairy productivity. The research highlights the significance of timely health monitoring in cattle to enhance overall dairy farm efficiency and animal welfare.

Uploaded by

jaber
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views14 pages

Schemos - Smart Cow Health Monitoring System: An Iot Based Cow Hoof Detection and Healthcare Alert System by Using LSTM Network

The document presents the Smart Cow Health Monitoring System (ScHeMoS), an IoT-based solution utilizing Long Short Term Memory (LSTM) networks to monitor cow health, specifically focusing on lameness detection. By collecting data from various IoT sensors, the system achieved an accuracy of 92.45% in identifying health issues in cows, which is critical for improving dairy productivity. The research highlights the significance of timely health monitoring in cattle to enhance overall dairy farm efficiency and animal welfare.

Uploaded by

jaber
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Scalable Computing: Practice and Experience, ISSN 1895-1767, http://www.scpe.

org
© 2024 SCPE. Volume 25, Issues 3, pp. 1702–1715, DOI 10.12694/scpe.v25i3.2785

SCHEMOS – SMART COW HEALTH MONITORING SYSTEM: AN IOT BASED COW


HOOF DETECTION AND HEALTHCARE ALERT SYSTEM BY USING LSTM NETWORK
DURAIRAJ.K ∗, DHILIP KUMAR.V †, AND KANAGACHIDAMBARESAN.G.R ‡

Abstract. Human life and existence are intertwined with a few domestic animals. One of the most important animals of this
kind is the cow. Cows play a vital role in daily activities. Most of the people in India consume cow’s milk as one of their major
nutrients. Monitoring the health of a cow’s everyday life is quite challenging. After infertility and mastitis, lameness is typically
ranked as the third most economically significant health issue in dairy herds.Lameness are caused due to genetics, lack in nutrition
i.e. a diet deficient in essential nutrients such as biotin, which can lead to hoof problems. Due to geographical environments like
cows kept in wet, muddy conditions are more likely to develop hoof problems. This investigation analyses the typical characteristics
of cow behavior, and a Smart Cow Health Monitoring System (ScHeMoS) using IoT is proposed to identify the cow’s health through
the data obtained from Internet of Things (IoT) sensors, including position, body temperature, stability, acceleration, and animal
feed. IoT is combined with Deep learning (DL) technique to monitor and diagnose animal health. We used the Long Short Term
Memory (LSTM) network to predict cow lameness by capturing the body temperature and other parameters, which will aid in
predicting their illness. The accelerometer values are stored so that it will further help to determine which cow is lame and which
is pregnant or regular and could be intimated to the care takers in the farms. We utilised a self collected dataset to perform the
investigation. By implementing this system, we achieved 92.45% accuracy and 0.92 as F1 score.

Key words: Animal Behaviour, Cow Hoof Health, IoT in animal monitoring, LSTM, ScHeMo.

1. Introduction. Cow’s milk will be the first choice as one of best nutrient consumed by infant to older
people in India or even in most of the countries .The demand for milk in India is raising daily. India’s market for
dairy products is anticipated to increase dramatically over the next few years due to an increase in consumers,
rising incomes, and a growing interest in nutrition. Dairy products that have been pasteurised and packaged
are becoming more popular in cities. Numerous national and international brands have joined the market
due to increased competition from the private sector, raising consumer expectations for quality. However, a
small percentage of people consume these packaged goods. Because of its flavour and perceived freshness,
unpackaged, raw milk from a neighbourhood milkman is still preferred in many parts of the nation. [1] Dairy
cow productivity is influenced by several factors, one of which is health. A sickness prevents dairy cows from
producing milk as efficiently, which lowers milk yield. Dairy cows can have up to 12 to 15 litres of milk per
day under normal circumstances, while diseased dairy cows can only generate 3 to 8 litres of milk per day. The
incapacity to monitor the ranchers’ shared understanding of the disease makes it challenging to identify and
treat diseased cows in the early stages.
Lameness in cattle are caused due to genetics, where some cow breeds may be predisposed to hoof problems,
lack in nutrition that is ,a diet deficient in essential nutrients, such as biotin, can lead to hoof problems, and
due to geographical environments like cows kept in wet, muddy conditions are more likely to develop hoof
problems. Fig. 1.1 (a) shows how a Lameness cow walks in a particular motion; (b) the kind of injury a cow
would have at the bottom of its hoof, which is something the untrained eyes cannot see,(c) the toes of the cow
are crossed because of bilateral damage, which must be cut . A major animal welfare issue in dairy cows is
lameness, which causes intense pain and strain, which enervates and decreases milk productivity. For example,
in the dairy form, less than 10% of cows are affected by lameness. Lower fertility rate are found among cows
∗ Department of Computer Science and Engineering, Vel Tech Rangarajan Dr.Sagunthala R&D Institute of Science and Tech-

nology, Avadi, Chennai 62, India. ([email protected])


† Department of Computer Science and Engineering, Vel Tech Rangarajan Dr.Sagunthala R&D Institute of Science and Tech-

nology, Avadi, Chennai 62, India. ([email protected])


‡ Department of Computer Science and Engineering, Vel Tech Rangarajan Dr.Sagunthala R&D Institute of Science and Tech-

nology, Avadi, Chennai 62, India. ([email protected])


1702
SCHeMoS – Smart Cow Health Monitoring System: An IoT based Cow Hoof Detection and Healthcare Alert System 1703

Fig. 1.1: Different forms of Hoof problems (a) Lameness (b) Injured cow hoof root (c) Bilateral crossed toes.

affected with lameness. Foot rot is an infection that causes sudden swelling, heat and inflammation in the foot,
resulting in severe lameness [2]. When evaluating structural soundness, one of the critical features to assess is
the hoof. Some hoof problems, such as excessive or uneven toe growth, may be caused by hereditary, dietary,
or environmental factors, or they may be symptoms of other health issues the animal is experiencing. The ideal
hoof will be free of cracks and flaws, with two symmetrical claws facing forward. The heel depth should also
be carefully monitored because animals with an excessive tilt to their hocks and pasterns might be exceedingly
shallow in the heel. The hoof should be dense and capable of supporting the animal’s weight without shattering,
as this might cause problems [3].
A corkscrew claw, or screw claw, is another symptom to look for while evaluating the hoof. This toe
twisting puts the hoof’s side wall in direct touch with the ground. At times, the disease manifests itself with
the toes pointing inward rather than outward. The typical symptoms of this illness are present in cattle older
than two years old. It can damage all hooves or only one of them [4]. Although the mode of inheritance is not
fully known, this condition is thought to be heritable. Due to improper weight distribution inside the toe, the
issue can cause lameness. Cattle suffering from this disorder must be discarded and eradicated from the herd
immediately.
Animals cannot communicate their health issues to human beings. Hence, this research suggests the
prototype of a wearable device for animals with the help of a Smart Cow Health Monitoring System (SCHeMo),
which shall be mounted on the animals that produce the alert message related to their health issues to both the
forest officer’s room and the veterinary doctors [5]. The primary parameter is to monitor the animals regularly.
It indicates whether they are suffering from diseases or in dangerous situations caused by natural disasters
like floods or wildfires. Therefore, this prototype will be user-friendly for evaluating animals’ behavioural
monitoring.
We propose SCHeMoS model which can serve as health alert system in cow lameness detection. The
research brings out:
- From observing to recognition and healing of the diseased cows, our method continuously monitors and
manages using IoT and LSTM model.
- A cutting-edge data analytical method aid in the precise detection of the animal behaviour.
- IoT sensors and actuators assist in detecting animal behaviour for early disease analysis and diagnosis.
- We use a rapid prototype model to monitor the animal and maintain a healthy habitat. To recognirmal
cows, SCHeMoS can be used by the farmers in identifying the lame cows
- Our proposed model outperformed the existing approaches in detecting the lameness of cows with the
accuracy of 92.45%.
The remainder of this article is structured as follows: Section 2 covers the literature review. Section 3
provides specifics on the proposed approach, while Sections 4 contains the implementation and 5 outline the
results that were attained. Section 6 concludes the investigation.
2. Related work. There have been numerous research projects on domestic animal surveillance recently.
Cow health monitoring is crucial in today’s society since it allows for the prediction of milk production. It
1704 Durairaj K, Dhilip Kumar V, Kanagachidambaresan GR

is essential because milk production is the primary income source for farmers with many cows. A health
observing system that focuses on several options are available. The issue with such systems is that they need
help forecasting milk production, which is crucial in determining a cow’s health. Video-based monitoring with
ResNet 3D and other DL approaches can recognise cow behaviours as resting, walking, and roaming [6]. Another
untrained ML model [7] was used to assess cow movement patterns and identify anomalies. It used collar, ankle,
or neck accelerometers.
Authors of [8] used gait analysis with accelerometers has been done on both people and animals .It has
been established that while accelerometer-based gait metrics are still comparatively immature, latest field in the
dairy industry includes the use of sensors that can be worn by cows, such as accelerometers. Sheep behaviour
and lameness categorization have both been studied using accelerometers and gyroscopes [9].
Use leg-mounted accelerometers [10] to identify cow lameness. Neck, foot, and throat tri-axial accelerome-
ters are used to predict lameness in sheep and have an overall accuracy of more than 85 percent. Wandering,
resting, eating, and sleeping were among the monitored actions. In [11] acceleration signal analysis has been
shown to have a reported accuracy of 91.9% when applied to the diagnosis of lameness in cows. Two 400-Hz
accelerometers were utilised by the authors of [12] to evaluate bilateral front limb impairment and foot disor-
ders by extracting the full rotation, standing phase, and range of motion. In dairy cows with hoof lesions, the
connection between gait features and movement score has been studied.
Reviews the use of accelerometer [13] in various clinical applications, including the assessment of gait
disorders, fall detection, and the monitoring of patients with neurological conditions. The authors also discuss
the advantages and limitations of accelerometer-based gait analysis, including its non-invasive nature and its
ability to provide objective measurements. They also highlight the importance of the development of appropriate
algorithms and methods for the analysis of accelerometer data. Finally, the authors suggest future research
directions to improve the accuracy and reliability of accelerometer-based gait analysis.
Examines accelerometers [14] which are devices that measure the acceleration of a cow’s movement, for
the categorization of cattle movement and activities in the dairy. The study used data from accelerometers
placed on cows in a commercial dairy farm to classify the cows’ behaviours, such as lying down, standing, and
walking. The authors used ML algorithms, such as RF and SVM, to classify the behaviours and found that
the accelerometer data was able to accurately classify the behaviours with a high accuracy. The authors also
discuss the potential of using this technology for cow lameness detection and for monitoring cow welfare in
dairy barns.
Authors of [15] explores the use of a combination of locating and accelerating the sensors to detect the
differences among cows while feeding that are affected with lameness. The study used data from sensors placed
on cows to track the cows’ movements and feeding behaviours, and analyzed the data using machine learning
algorithms. The authors found that the sensor data accurately distinguishes healthy and unhealthy cows based
on their feeding behaviours. The authors also covered the possibility of employing this technology to identify
lameness among cattles and the significance of taking feeding behaviour into account as a sign of lameness.
Electroencephalogram (EEG) recordings [16] of patients with a range of poor sleep, including restlessness,
snoring, and nerve pain, were employed in the study to collect data. and applied deep learning algorithms to
classify the patients into different groups based on their disorder. The authors found that the deep learning
algorithms were able to accurately classify the patients into different groups with high accuracy. The authors
also discussed the potential of using this technology for the diagnosis and treatment of sleep disorders, and
the importance of considering multiple bio signals in the analysis. Few limitations of the literature review are
presented in Table 2.1. The goal of this investigation is to create a recurrent neural LSTM model to properly
and completely categorise cow behavioural traits, particularly those connected to lameness.
3. Proposed Work. This part contains detailed description of the proposed approach, dataset prepa-
ration, data pre-processing and methods and materials used to complete the investigation. The proposed
architecture is depicted in Fig. 3.1. Initially the data is pre-processed after acquiring it. The cleaned data
is given as input to the LSTM model for classifying lameness. The main advantages of LSTM is that they
are much better at managing long-term dependencies. This is due to their capability to remember data for
prolonged periods of time. Second, LSTMs are much less vulnerable to the vanishing gradient issues. This also
give optimal predictions during machine learning when compared to existing algorithms.
SCHeMoS – Smart Cow Health Monitoring System: An IoT based Cow Hoof Detection and Healthcare Alert System 1705

Table 2.1: Overall results of the proposed approach

Work Methodology Parameters used Results Limitations


The average MAPE
MAPE (Mean Body Small sample size of cows
value to identify the
Casey Absolute Temperature used in the study, which
body temperature and
et. al Percentage Error) Detection, Heart limits the generalizability of
metric for heart beat rate
[17] computation Rate Detection the results to the wider
is 1.254, 2.434
method. Minutes population of dairy cows
respectively.
The study only used data
TO1 to TO5 is used Breathing frequency Monitoring the cow’s from accelerometers placed
Lamb et to synchronise sensing rnit, behaviour, health, and on the front legs of the cows,
al [18] communication Monitoring the stress.Accuracy rate is which may not provide
protocols. activity of cow. measured as 87.61% complete picture of the cows
gait and lameness status.
The study only used data
The milk yield Monitor cow’s health, from accelerometers placed
Thorup prediction model and vets, that quickly on the frontlegs of the cows,
Temperature &
et al was created using identifies and treat which may not provide a
Humidity
[19] the MATLAB with minor health issues with complete picture of the cows
ThingSpeak. accuracy of 85.01% gait which affects the
accuracy.
The study used a simple
Used IoT algorithm for lameness
techniques. The detection and did not use
MQTT protocol is advanced machine learning
Mastitis, Bloat,
used for data techniques to improve the
PMK, Anthrax, IoT and smart systems
Haug et communication accuracy of the lameness
Brucellosis, are integrated in
al [20] within gateway and detection, which could be a
Leptospirosis, monitoring the cattles.
nodes. HTTP is limitation in terms of the
Myiasis, Scabies
used for data performance of the system.
transmission within IoT systems used MQTT
server and gateway which has higher
computational complexities.

Fig. 3.1: Proposed architecture

3.1. Data pre-processing. To prepare a dataset for cow lameness prediction, we gathered data on cow
behavior and physical characteristics, as well as information on their environment and any potential causes of
lameness. This may include data on the cow’s movement patterns, gait, and posture, as well as information
on the flooring and bedding in their living area. Additionally, data on any injuries or conditions that may
contribute to lameness specifically hoof infections or joint issues are collected. It is important to have a large
1706 Durairaj K, Dhilip Kumar V, Kanagachidambaresan GR

Fig. 3.2: Collar Sensor placed on the cow to collect data

Table 3.1: Category wise cows used for the investigation

Cow breed Gender No. of cows used


Angus Male 12
Angus Female 11
Brahman Male 10
Brahman Female 8
Crossbred Male 12
Crossbred Female 14
Charolais Male 11
Charolais Female 9
Total 87

and diverse dataset, including both healthy and lame cows, to train our model effectively. The data sets
include information on the following types of cattle: Angus, Crossbreds and others. Table 3.1 shows statistical
information like breeds, gender and number of cows used to collect the data. The data collection was carried
out in a farm for 35 days where all the above said breeds are available.
Around four cow breeds are used to prepare the sensor’s raw data set, representing different species and
ages. Cattle state is divided into eight subcategories, including relaxing, chewing, highly active, moderately
active, gasping (heavy breathing), eating, and roaming. The detailed explanation of various conditions of the
cow is shown in Table 3.1. The collected dataset contains thorough information for several cattle statuses.
Sensors deployed in the neck of the cow as shown in Fig. 3.2 to collect various information Each sensor records
the state of the cows for every 30 seconds, and 12,892 data points were gathered for each cow during the time
16:30 IST on December 12,2022.A sample of the collected dataset is shown in Table 3.2.
3.2. Data segmentation. Segmentation is the initial step in the data processing process. Cows belonging
to the same breed are grouped together in the statistics. We utilised R programming language to segment the
data since the source data were extremely large. The number and breeds of cows used to prepare the dataset
is shown in Table 3.1. A large volume of data makes it easier to analyse general characteristics of data and
prevent miscalculation brought on by specific and individual data.
We collected data based on various positions of the cow. Table 3.2 shows a few of the cow positions used
to collect data for our experiment. The collected data is segmented as per the same breed with a difference in
gender. A sample of sensor data from a walking cow of the Brahman breed is shown in Table 3.3. Px, Py, and
Pz represent the cow’s movement directions. These values are compared to determine the cow’s weaning style.
To accurately classify hoof foot, the cow’s body temperature is also recorded because a change in temperature
would also cause a change in the cow’s walking style. We collected data and segmented it for all the actions
listed in Table 3.2. for all four breeds of cows.
3.3. Data Cleaning. Data cleaning in a cow disease dataset involves a series of steps to ensure that
the data is accurate, consistent, and usable for analysis. Removing duplicate records involves identifying and
SCHeMoS – Smart Cow Health Monitoring System: An IoT based Cow Hoof Detection and Healthcare Alert System 1707

Table 3.2: Various Positions of Cow used for data collection

Cow ID Position Explanation


NC4231 Ideal The normal cow’s position was ideal.
NC4232 Grazing The average cow here was in a grazing position.
NC4233 Drinking The normal cow is drinking water.
NC4234 Walking The normal cow was walking around.
PC6241 Lying Down The pregnant cow was lying down on the field.
PC6242 Walking The pregnant cow was walking around.
PC6243 Sleeping The pregnant cow was sleeping.
LC3351 Ideal The Lame cow was in an ideal position.
LC3352 Walking The Lame cow was walking around.
LC3353 Grazing The Lame cow was in a grazing position.

removing any records that are identical or nearly identical. Handling missing data, involves identifying and
addressing missing data, such as by removing records with missing values, imputing missing values, or flagging
records with missing data for further investigation. For instance, the relaxed condition of the cow will be marked
as zero for specific hour if the cow shows no change in the position. If lot of damage data is collected in that
hour; it will affect how the average time stamp is determined. Removing irrelevant data involves identifying
and removing data that is not relevant to the analysis. For example Deleting faulty data along with the
accompanying time serial number will prevent them from being factored into the average period computation.
In our investigation the sensor delivers very less amount of inaccurate data along with its detection and
transmission of the cow’s state. Even this less inaccurate data would impact the classification accuracy of the
model. Consequently, cleaning up the faulty data is the first step. We used the above methods to clean up the
data.
3.4. Prediction using LSTM. Based on the research discussed above, we use the LSTM model in this
part to predict the state of a cow lameness whether it is affected with hoof foot.. To be clearer, it is first detailed
how to build an LSTM model as well as the characteristics and structure of LSTM. Second, the cow condition
is anticipated and simulated using the LSTM model. The model is finally optimised to raise its accuracy. The
process of using LSTM to predict lameness in cows would involve the following steps:
Collect data: Collect data related to the cow’s behavior, sensor readings, and other relevant factors that
may indicate lameness.
Pre-processing: Pre-process the data by cleaning and normalizing it, as well as converting it into a format
that can be used by the LSTM model.
Build the LSTM model: Use the pre-processed data to train and build the LSTM model using a
suitable deep learning library such as TensorFlow or Keras. Evaluation: Evaluate the model’s performance
using appropriate metrics such as accuracy, precision, and recall.
Fine-tuning: Fine-tune the model as necessary by adjusting the model parameters, adding additional
features, or trying different architectures.
Deployment: Once the model is trained and fine-tuned, it can be deployed for use in predicting the
likelihood of lameness in cows.
LSTM (Long Short-Term Memory) is a type of Recurrent Neural Network (RNN) that is particularly well-
suited for modelling time-series data and sequences. It can be used to predict the likelihood of lameness in
cows by analyzing data from sensor readings, cow behavior, and other related factors. A simple LSTM cell is
as shown in Fig. 3.3. Equ. 3.1 to to 3.5 are used by the LSTM network to process the input. The sensor data
is given as input through the input gate it ,predicted output is obtained from the output gate ot and the forget
gate ft is used to analyse the time series data with the help of the memory cell ct .

it = sigmoid (Wix × xt + Wih × h{t − l} + bi ) (3.1)


1708 Durairaj K, Dhilip Kumar V, Kanagachidambaresan GR

Table 3.3: A sample of male Brahman Cow’s walking record

Cow Body
Date Time Px Py Px
Temperature
08 − 12 − 2022 16 : 31 : 02 37.06 2731 7146 9078
08 − 12 − 2022 16 : 31 : 04 37.13 2732 7606 9035
08 − 12 − 2022 16 : 31 : 06 37.19 2730 7466 8872
08 − 12 − 2022 16 : 31 : 07 37.31 2729 7603 8943
08 − 12 − 2022 16 : 31 : 09 37.44 2731 7645 9022
08 − 12 − 2022 16 : 31 : 10 37.5 2732 7630 9021
08 − 12 − 2022 16 : 31 : 12 37.5 2730 7531 8815
08 − 12 − 2022 16 : 31 : 13 37.63 2728 7690 8903
08 − 12 − 2022 16 : 31 : 15 37.75 2729 7738 9062
08 − 12 − 2022 16 : 31 : 17 37.81 2727 7716 9067
08 − 12 − 2022 16 : 31 : 20 37.94 2737 7763 9249
08 − 12 − 2022 16 : 31 : 21 38.06 2731 7591 9140
08 − 12 − 2022 16 : 32 : 14 38.44 2730 7875 9248
08 − 12 − 2022 16 : 32 : 16 38.44 2734 7854 9251
08 − 12 − 2022 16 : 32 : 20 38.5 2734 7913 9292
08 − 12 − 2022 16 : 32 : 22 38.5 2738 7897 9258
08 − 12 − 2022 16 : 32 : 24 38.56 2741 7922 9297
08 − 12 − 2022 16 : 32 : 30 38.63 2739 7811 9226
08 − 12 − 2022 16 : 32 : 59 38.56 2737 7772 9409
08 − 12 − 2022 16 : 33 : 45 38.69 2737 7746 9056
08 − 12 − 2022 16 : 33 : 46 38.75 2737 7779 9044
08 − 12 − 2022 16 : 33 : 49 38.81 2737 7829 9126
08 − 12 − 2022 16 : 33 : 51 38.88 2732 7820 9142
08 − 12 − 2022 16 : 33 : 52 38.88 2734 7829 9183
08 − 12 − 2022 16 : 33 : 54 38.94 2731 7821 9164
08 − 12 − 2022 16 : 33 : 56 39 2733 7831 9190
08 − 12 − 2022 16 : 33 : 57 39 2733 7841 9213
08 − 12 − 2022 16 : 33 : 59 39.06 2733 7837 9241
08 − 12 − 2022 16 : 34 : 00 39.13 2729 7824 9234

ft = sigmoid (Wfx × xt + Wf h × h(t − l} + bt ) (3.2)

ot = sigmoid (Wox × xt + Woh × h{t − l} + bo ) (3.3)

ct = ft × c{t − l} + it × tanh (Wcx × xt + Wch × h{t − l} + bd ) (3.4)

ht = ot × tanh (ct ) (3.5)

where xt , ht , ct , are the input, hidden state, memory cell for the time stamp t respectively for it (input gate),
ft (forget gate), and ot (output gate) respectively, The weight matrices for the input, output and forget gate
are Wi , Wf , Wo and bias terms are bi , bo , bf respectively. We used sigmoid as the sigmoid function; tanh is the
hyperbolic tangent function [21].
Before applying the created LSTM model for cow status prediction, it is essential to find out the inputs,
form of output, time series data. According to the properties of the data sets, predicted output should be the
hoof foot affected status of the cow [22]. Hence, one difficult part of this approach is figuring out the input
variables. A known fixed periodic function should be the input since periodic changes will be the output. To
SCHeMoS – Smart Cow Health Monitoring System: An IoT based Cow Hoof Detection and Healthcare Alert System 1709

Fig. 3.3: LSTM cell structure

be more precise, it is appropriate to choose total hours as the input variable because the state cycle of cow is
one day.
The LSTM model’s input and output are periodic. The difference is that while each cycle’s output has a
different value, this cycle’s input has a fixed value[23]. In other words, regardless of time, the same input may
produce many results. The matching time series for the input is not the same even though the input is the
same [24]. As a result, the LSTM model is capable of handling situations where a single input corresponds to
a number of outputs in a time series.
3.5. Feature extraction. In this study, two features RMS (Root Mean Square) and mean were used to
extract the features of the sensor data. Equ. 3.6 and Equ. 3.7 are used to perform the feature extraction by
the LSTM model.
v
u
u1 X n
RpX = t PXi (3.6)
n
i=1

1X
n
m (PXj ) = PXi (3.7)
n
i=1

where PX is PX-axis data, P Xj is the record j of PX, n are the samples number and fixed as n = 32; P Xi is
the ith sample of record P Xj ; m(P Xj ): mean of P Xj , RP Xj : root means square of P Xj .Hence the formulae
for Px , Py , andPz axis are similar.
3.6. Hyperparameter optimisation. To further improve the performance of the proposed model we
performed hyper parameter optimisation. The number of hidden layers of the LSTM model is selected to be
7,we started with the number of neurons from 32 and gradually increased to 64.The dropout rate is randomly
selected from 0.2 and we obtained most optimised accuracy of 92.4% at the rate of 0.1. The learning rate of
the model is selected to be 0.001 with the batch size 0f 128.We achieved highest accuracy at the 120th epoch.
The results obtained through hyper parameter optimisation are as shown in Table 3.4.
4. Implementation. This article describes a monitoring system that records a cow’s heart rate, rumina-
tion rate, relative humidity, and body temperature at regular intervals to predict lameness. The parameters
collected will then be sent via NodeMCU to a website called Thing Speak for processing and health evaluation.
This study focuses on locating cow hoof wounds and keeping tabs on the well-being and behaviour of the subject.
Fig. 4.1 depicts the basic layout of the hardware representation of the proposed system. A 4.7K ohm 1/2 Watt
Resistor, AD converter (ADS1115), Temperature Sensor (DS18B20), Accelerometer (ADXL335), NodeMCU
(ESP8266), 5V Battery, and Micro SD Card Reader Module are used to build the system. Another method for
developing NodeMCU using a well-known IDE, the Arduino IDE. We may also use the Arduino programming
1710 Durairaj K, Dhilip Kumar V, Kanagachidambaresan GR

Table 3.4: Hyper Parameter Optimisation.

Parameters Optimised values


No. of LSTM layers 7 Layers
Neurons 64
Learning rate 0.001
Epoch 120
Batch size 128
Dropout 0.1
Trainingloss 0.4357
Testingloss 4.9821
Error rate 0.167

Fig. 4.1: Hardware architecture of SCHeMoS

environment to create applications for NodeMCU. The ADXL335 is used to find the accurate position of the
cow. Based on the cow movement, various positions like Px , Py and, Pz have been calculated.
4.1. PCB Design of SCHeMoS.
4.2. Product kit (Prototype). Fig. 4.3 (a) shows how all sensors are mounted and fixed by a double-side
PCB board, and this process is a preparation for Fig. 4.3 (b), which shows the soldering of all the particulars
with a jumper wire. Then, Fig. 4.3 ( c) shows how everything is contained in a box to hold the product using
a 3D printer. Finally, Fig. 4.3(d) shows the complete design after everything is collected and appropriately
adjusted.
Fig. 4.4 (a) shows the ideal position of the cow after applying the device around the neck. Usually, a cow
would shake its head in case of finding a burden that affects its liberty of motion, but luckily the device would
not cause such a disturbance. As the cow drinks from the bucket, as in Fig. 4.4 (b) 12, it is easy for the cow
to bend over and drink without any burden on the device. In Fig. 4.4 (c), the cow can be dragged easily for a
walk without harming the device’s purpose or the cow’s neck. According to the survey, cattle constantly graze
for 10- 15 minutes and drink at an average rate for 2-3 minutes. The above three positions have been tested in
all three categories of cows. A Timestamp will be generated each minute, and this information will be saved on
the MO20’s SD card. The comparison after applying the test to the three different categories of cows resulted
in various machine-learning algorithms. The system above SCHeMoS will assist the owner in taking preventive
and curative steps as soon as possible, preventing catastrophic losses and the owner can take rapid action.
5. Results and discussion. From the results obtained it sounds like the LSTM model used for cow
lameness detection is performing well in general, with the exception of the predictions for Brahman males.
This could be due to the factors mentioned, such as their continuous rest state and less movement from one
SCHeMoS – Smart Cow Health Monitoring System: An IoT based Cow Hoof Detection and Healthcare Alert System 1711

Fig. 4.2: Final PCB board circuit of SCHeMoS using CAD software

Fig. 4.3: SCHeMoS Hardware design for implementation(a) Sensors with double sided PCB board (b) Circuit
of SCHeMoS (c) Preparing box for SCHeMoS in 3D printer (d) Design of SCHeMoS

Fig. 4.4: Position of the cow after fixing the device (a) Ideal position of the cow (b) Drinking position (c)
Walking position
1712 Durairaj K, Dhilip Kumar V, Kanagachidambaresan GR

Table 5.1: Performance of the Proposed System

Model Classification Accuracy F1 Score Specificity Recall Precision


Affected with lameness 92.45 0.926 0.931 0.925 0.918
Not Affected with lameness 92.36 0.919 0.92 0.919 0.921

Fig. 5.1: Confusion matrix

place to another. It’s important to note that the accuracy of DL models depends on the quality and size of
the data used to train them. In this case, the proposed LSTM model is able to precisely calculate the active
movement of the next cow, which is a good indication that it is a good fit for predicting cow lameness task.
Additionally, the proposed LSTM model could be used for time-series prediction and it is important to pre-
process the data accordingly, like normalizing the data, adding time-lag features, etc to obtain more accuracy.
We assessed our obtained results by using few of the below ML metrics from Equ. 5.1 to 5.4. tr_pst, are
true positive (actually lame and lameness correctly predicted), tr_ngt are true negative (actually not lame
predicted as not lame), fp_pst are false positive (actually lame but predicted as not lame),fp_ngt are false
negative (actually not lame but predicted as lame). Table 5.1 shows the overall results obtained from the
proposed approach.

Accuracy = (tr _pst + tr_ngt) / (tr _pst + tr_ngt + f s_pst + f s_ngt) (5.1)

Recall = tr _pst/ (tr _pst + f s_ngt) (5.2)

Precision = tr_pst/ (tr_pst + fs_pst) (5.3)

F1 Score = 2 × ( precision × recall )/( precision + recall ) (5.4)

To visualise the results obtained more precisely we represented the classified data in the form of confusion
matrix. It summarizes the performance of a classification algorithm. Fig. 5.1 represents the confusion matrix
for our approach. A typical confusion matrix for cow lameness detection would have the following structure:
We compared our results with few of the existing approaches and the comparison revealed that the proposed
approach have outperformed than the existing approaches. The comparison results are shown in Table 5.2. The
training and testing accuracy of our SCHeMoS approach is shown in Fig. 5.2. It is observed that the testing
accuracy gradually increases when the input data is increased. The training loss of the proposed model reduces
to 0.2016 after the 120th epoch. The model stabilises at the learning rate of 0.001.
SCHeMoS – Smart Cow Health Monitoring System: An IoT based Cow Hoof Detection and Healthcare Alert System 1713

Table 5.2: Existing versus proposed approach.

Logistic Random Proposed


Cow Category SVM K-NN
Regression Forest SCHeMoS Model
Lameness not
79% 83% 86% 90% 92.36%
affected
Lameness
80% 85% 90% 90% 92.45%
affected

Fig. 5.2: Training and testing accuracy

Fig. 5.3: ROC curve for the proposed classifier

A binary classifier’s performance is depicted graphically by a Receiver Operating Characteristic (ROC)


curve. The true positive rate (tr_pst), often referred to as recall or sensitivity, is represented on the y-axis
while the false positive rate (fs_pst) is represented on the x-axis. Sequential and time series data are both
well suited for our LSTM-based SCHeMoS model. The time-series data from the cow lameness data set can be
analysed and classified using it. The curve line increases as the number of input is increased and stays constant
at the 120th epoch with highest accuracy of 92.45%.The ROC of the proposed approach is shown in Fig. 5.3.
1714 Durairaj K, Dhilip Kumar V, Kanagachidambaresan GR

6. Conclusion. This research has suggested cow hoof health (lameness) monitoring using the sensor data
obtained from the cow’s position. We used LSTM network to classify hoof affected or not affected based
on the input sensor data of cows performing actions like move, sit,walk,graze and drink. The farmer/diary
maintenance person is alerted through IoT devices when the possibility surpasses a specified threshold. As per
our result, the SCHeMoS model reduces the computational complexity by classifying in reduced time than few
of the existing approaches and also reduced memory storage. In this work, the main goal is to build a cow
monitoring model made up of IoT devices on a farm, which is used to collect data of cows in various positions,
temperature, grazing habit etc.This collected data is cleaned and given as input to a LSTM network to predict
the lameness in cows. After the noise is taken out of the data, a DL based LSTM model for cow lameness
detection is built. The model is capable of predicting how the cow’s position will transform over the next phase.
When the model’s predictions are compared to what actually obtained with few of the existing approaches, it
shows how accurate and useful it is.The error rate of the model is recorded as 1.201 with the training loss of
0.2016, validation loss as 0.316 and overall accuracy of 92.45%.This model also has its limits. It needs a bunch
of input data to learn, and if small amount of data is given as input, the model’s prediction accuracy may
reduce or sometime may be inaccurate.

REFERENCES

[1] Chao,Ludovico,Korkut,Tokgoz,Jim,Sihan,Hiroyuki, Integrated Data Augmentation for Accelerometer Time Series in


Behavior Recognition: Roles of Sampling, Balancing, and Fourier Surrogates, in IEEE Sensors Journal, vol. 22, no. 24,
(2022), pp. 24230-24241. doi: 10.1109/JSEN.2022.3219594.
[2] Dedi Darwis, Abhishek R Mehta, Novi Eka, Samsugi, Priya, Digital Smart Collar: Monitoring Cow Health Using
Internet of Things International Symposium on Electronics and Smart Devices (ISESD), (2022), DOI: 10.1109/IS-
ESD56103.2022.9980682.
[3] Boris,Evstatiev,Nikolay,Valov,Seher,Kadirova,Teodo,Nenov Implementation of a Prototype IoT-Based System for
Monitoring the Health, Behavior and Stress of Cows, 2022 IEEE 9th Electronics System-Integration Technology Confer-
ence (ESTC) IEEE,DOI: 10.1109/ESTC55720.2022.9939489.
[4] M. Alsaaod, M. Luternauer, T. Hausegger, R. Kredel and A. Steiner, The cow pedogram Analysis of gait cycle
variables allows the detection of lameness and foot pathologies. J. Dairy Sci. , vol. 2, no. 100, (2017), pp. 1417–1426, 2017
[5] Akash Trivedi, Pinaki Sankar Chatterjee CARE: IoT enabled Cow Health Monitoring System, 2022 International
Conference on Intelligent Technologies (CONIT), (2022), IEEE | DOI: 10.1109/CONIT55038.2022.9847701.
[6] Abdul Aziz Chaudhry, Rafia Mumtaz, Syed Mohammad Hassan Zaidi, Muhammad Ali Tahir, Syed Hassan Muza-
mmil School Internet of Things (IoT) and Machine Learning (ML) enabled Livestock Monitoring, 2020 IEEE 17th
International Conference on Smart Communities: Improving Quality of Life Using ICT, IoT and AI (HONET), (2020)
IEEE | DOI: 10.1109/HONET50430.2020.9322666.
[7] G. Suseendran, D. Balaganesh Cattle Movement Monitoring and Location Prediction System Using Markov Decision
Process and IoT Sensors, 2021 2nd International Conference on Intelligent Engineering and Management (ICIEM).
[8] Varun Mhatre, Vishwesh Vispute, Nitin Mishra, IoT based Health Monitoring System for Dairy Cows ”IoT based Health
Monitoring System for Dairy Cows”, IoT based Health Monitoring System for Dairy Cows, (2020).
[9] Achour Brahim, Belkadi Malika, Aoudjit Rachida, Lalam Mustapha, Lalam Mustapha, Laghrouche Mourad Dairy
cows real-time behaviour monitoring by energy-efficient embedded sensor, IEEE, (2020).
[10] Pratama, Y. P., Kurnia Basuki, D., Sukaridhoto, S., Yusuf, A. A., Yulianus, H., Faruq, F., and Pu-
tra, F. B. Designing of a Smart Collar for Dairy Cow Behavior Monitoring with Application Monitoring
in Microservices and Internet of Things-Based Systems. 2019 International Electronics Symposium (IES), (2019).
https://doi.org/10.1109/elecsym.2019.8901676.
[11] S. T. Ahmed, V. V. Kumar and J. Kim AITel: eHealth Augmented-Intelligence-Based Telemedicine Resource Recommen-
dation Framework for IoT Devices in Smart Cities, in IEEE Internet of Things Journal, vol. 10, no. 21, (2023) pp.
18461-18468„ doi: 10.1109/JIOT.2023.3243784.
[12] Vannieuwenborg, F., Verbrugge, S., and Colle, D. Designing and evaluating a smart cow monitoring sys-
tem from a techno-economic perspective. 2017 Internet of Things Business Models, Users, and Networks, (2017).
https://doi.org/10.1109/ctte.2017.8260982.
[13] Mulla, A. I., Mulik, A. P., Prashant, A., and Gawai, D. D. Continuous health surveillance system
for cattle. 2017 International Conference on Intelligent Computing and Control Systems (ICICCS), (2017).
https://doi.org/10.1109/iccons.2017.8250656
[14] Khanh, P. C. P., Dinh Chinh, N., Cham, T. T., Vui, P. T., and Tan, T. D. Classification of cow behavior using 3-DOF
accelerometer and decision tree algorithm. 2016 International Conference on Biomedical Engineering (BME-HUST),
(2016). https://doi.org/10.1109/bme-hust.2016.7782100.
[15] Smith, K., Martinez, A., Craddolph, R., Erickson, H., Andresen, D., and Warren, S. An Integrated Cat-
tle Health Monitoring System. International Conference of the IEEE Engineering in Medicine and Biology Society,
(2006).https://doi.org/10.1109/iembs.2006.259693.
SCHeMoS – Smart Cow Health Monitoring System: An IoT based Cow Hoof Detection and Healthcare Alert System 1715

[16] Vannieuwenborg, F., Verbrugge, S., and Colle, D. Designing and evaluating a smart cow monitoring sys-
tem from a techno-economic perspective. 2017 Internet of Things Business Models, Users, and Networks, (2017).
https://doi.org/10.1109/ctte.2017.8260982.
[17] S. T. Ahmed, V. V. Kumar, K. K. Singh, A. Singh, V. Muthukumaran, and D. Gupta, 6G enabled federated learning for
secure IoMT resource recommendation and propagation analysis Computers and Electrical Engineering, vol. 102, (2022),
p. 108210, doi: 10.1016/j.compeleceng.2022.108210.
[18] Khatate, P., Savkar, A., and Patil, C. Y. Wearable Smart Health Monitoring System for Animals. 2nd International
Conference on Trends in Electronics and Informatics (ICOEI), (2018). https://doi.org/10.1109/icoei.2018.8553844.
[19] Ronghua, G., JingQiu, G., and Jubao, L. Cow Behavioral Recognition Using Dynamic Analysis. International Conference
on Smart Grid and Electrical Automation (ICSGEA), (2017). https://doi.org/10.1109/icsgea.2017.26.
[20] Junior, R. L. IoT applications for monitoring companion animals: A systematic literature review. 14th International
Conference on Innovations in Information Technology (IIT), (2020). https://doi.org/10.1109/iit50501.2020.9299045.
[21] 21. Natarajan, R., Lokesh, G. H., Flammini, F., Premkumar, A., Venkatesan, V. K., and Gupta, S. K. A Novel
Framework on Security and Energy Enhancement Based on Internet of Medical Things for Healthcare 5.0. Infrastructures,
8(2), (2023), 22. https://doi.org/10.3390/infrastructures8020022.
[22] Sindu Divakaran, Lavanya Manukonda, N Sravya, Melinda Morais M, Janani P, Sindu Divakaran, Lavanya
Manukonda, N Sravya, Melinda Morais M, Janani P. IOT clinic-Internet based patient monitoring and diagno-
sis system. IEEE International Conference on Power, Control, Signals and Instrumentation Engineering (ICPCSI-2017).
[23] Panda, S., and Panda, G. Intelligent Classification of IoT Traffic in Healthcare Using Machine Learn-
ing Techniques. 2020 6th International Conference on Control, Automation and Robotics (ICCAR), (2020).
https://doi.org/10.1109/iccar49639.2020.9107979.
[24] Ankit Bhavsar, and Harshal Arolkar ZigBee Based Network Architecture for Animal Health Monitoring, 2015 1st
International Conference on Next Generation Computing Technologies (NGCT-2015).

Edited by: Polinpapilinho Katina


Special issue on: Scalable Dew Computing for Future Generation IoT Systems
Received: Nov 1, 2023
Accepted: Feb 1, 2024

You might also like