CattleCare IoT-Based Smart Collar For Automatic Continuous Vital and Activity Monitoring of
CattleCare IoT-Based Smart Collar For Automatic Continuous Vital and Activity Monitoring of
IIIT Naya Raipur, India IIIT Naya Raipur, India IIIT Naya Raipur, India
Email : [email protected] Email : [email protected] Email : [email protected]
Debanjan Das
IIIT Naya Raipur, India
Email : [email protected]
Abstract—Farm productivity is increasing these days drasti- be increased. For this different types of sensors are to be
cally due to farm automation and new technical procedures. The used [2], [3]. Regular human-cattle connection has all but
cattle health monitoring system is a current research topic in disappeared as a result of the expansion of dairy farms, which
agricultural automation. However, most of them focus on health
parameters and do not include the feedback system. This paper has led to the automatic milking systems that are replacing
proposed an IoT-based CattleCare platform for both vital and traditional milking methods. A farm-level analysis of the
activity monitoring of the cattle. The Cattle Activity Prediction health, welfare, and comfort of dairy cattle can be done by
algorithm classifies the activities of cattle in order to keep track of observing their behaviour. Certainly, behavioral changes are
behavioral changes in cattle as well as their health parameters. obvious warning signs of welfare and health issues with cattle.
The system algorithm can predict cattle activity like grazing,
stationary, or walking with an accuracy of 91.46%. The sickness Consequently, these may be included into an early warning
of the cattle can be observed by the change in its behavior for that system as input. For the animals to produce milk, they must
it is really important to keep track of its activities. This model spend a significant amount of time either lying down or eating.
has stages like data collection, storage, analysis, prediction and Therefore, being aware of their movement is crucial for mon-
feedback. With the advancement in technology and the existence itoring and managing their behavioural patterns and activities
of the internet, we can practically connect any device to the
internet and implement the concept of IoT. in order to gather data on their productivity and health. As a
Index Terms—Farm automation, Health parameters, Feed- result, various techniques for monitoring behavioural changes,
back, Cattle Activity Prediction algorithm including precise sensing and smart processing, have become
crucial for the herd’s survival.
I. I NTRODUCTION
There are different IoT applications that are being used
The cattle sector is vital to the global economy. Animals in the field of health monitoring fields like integrated health
like cows, buffaloes, sheep, goats, and others are crucial to monitoring system, using Arduino and LabVIEW technologies
rural life. Around 50% of India’s population are employed in movement monitoring of cattle, non-invasive sensor technol-
the field of agriculture and animal husbandry [1]. Farmers are ogy [5], [6], [7]. The existing methods or techniques mainly
suffering severely as a result of a variety of diseases that are focuses on
affecting the farm’s animals. However, farmers must devote
more time and resources to constant monitoring. Farmers • Sensors: They use various sensors for getting data about
cannot entirely rely on their ongoing visual observations since various parameters which makes the sensor node more
new animal health disorders are emerging that are difficult complex. They don’t mention or propose about building
to prevent. In order to solve this issue, the outdated methods the sensor node in an understandable way.
of monitoring cow health must be replaced with more modern • Disease: The main aim of many proposed systems is to
ones. To aid local farmers, an intelligent method of cow health detect particular disease using the sensor information.
monitoring must be developed. In order to understand animal • The end user can’t access the cloud or they are not
behaviour and track biological reactions, precision livestock notified on time.
farming techniques are integrated with the most recent digital
technology. The automated systems for checking up on the The proposed system is cost effective and successfully
health of cattle are especially super beneficial for dairy farms tracks the health parameters of the cattle and its activity for
in rural sections of the nation where the availability of doctors every short intervals of time so that the cattle owner can know
is limited. what his/her cattle is doing and it also shows the visualization
Manual supervision is used in the traditional method of for what duration of time the cattle is doing each activity so
livestock monitoring, needs a lot of skilled labour and time [2]. that if there is any activity that is less its usual duration of
Therefore, it will be preferable to automate the monitoring of time, the farmer can understand that his/her cattle is suffering
cattle in a cost-effective manner so that their lifespan may with health problem.
2
Authorized licensed use limited to: Universitas Brawijaya. Downloaded on October 21,2024 at 22:49:48 UTC from IEEE Xplore. Restrictions apply.
Data Collection from Sending data to cloud &transferring of Analysis and prediction
sensors collected data of data to the user
NodeMCU
DS18b20 ESP8266 3D printed case
Power bank
are sent to google firebase cloud. The data collected by google google sheet. The activity of the cattle can be predicted by
firebase is sent to googlesheets so that the readings can be using CAP(Cattle Activity Prediction) algorithm 11. To predict
shown graphically and if the readings exceed their threshold the activity of the cattle we use Machine Learning algorithm
values, an email will be sent to the cattle owner to make him - One vs all Logistic Regression with the help of BigML
alert. If the pulse value exceeds the threshold value and the extension which is found in the google sheet. Using this, the
acceleration along y-axis also exceeds more than 3.8, then the ML algorithm will predict whether the cattle is stationary or
email will be sent as the heartbeat rose due to fast movement walking or eating. The activity will be automatically updated
of cattle. The data that is collected by the firebase cloud will into the google sheets whenever a new row is created with help
be updated into the google sheets for every 5 minutes. Here we of zapier, a third party application that is used to automate the
use the threshold values as that of normal body temperature things whenever a set trigger happens, an action is performed.
(36°C-40°C) and pulse value (76-96 beats/min) [4] of a cattle. Here we set the the trigger as creation of new row in google
sheet and action as prediction of activity with the help of
C. Cattle Activity Prediction bigML. The duration of the activity can be calculated by
number of times a particular activity is predicted divided by 60
The accelerometer values are sent by NodeMCU to the
gives the number of hours that particular activity is performed.
google cloud for every minute and from there it is sent to
3
Authorized licensed use limited to: Universitas Brawijaya. Downloaded on October 21,2024 at 22:49:48 UTC from IEEE Xplore. Restrictions apply.
The google sheet which contains all the data from the cattle
will be shared to the cattle owner through its link.
Eating
Walkingg
Logistic Regression Model
D. Preparation of data
The 3D printed case is wound over the neck of the cattle.
The dataset was prepared by observing each activity of the Fig. 5. Proposed CattleCare process flow for health and activity monitoring
cattle for 1 hour daily for 30 days. This dataset was uploaded
to the bigML extension in the google sheets. The summary of
the dataset collected on a day is as shown in Fig 4.
1
hθ (x) =
1 + e−x
− log (hθ (x)) if y = 1
Cost (hθ (x), y) =
− log (1 − hθ (x)) if y = 0
The simplified
cost function can be written as
m
1 (i)
J(θ) = − y log hθ x(i) + 1 − y (i) log 1 − hθ x(i)
m i=1
The value of the theta can be known from the input training dataset
The value of the above expression will be calculated for
each new row of the accelerometer values for all the three
Fig. 4. Summary of sample of the dataset activities and the highest of them will be shown as it will
have highest probability and is displayed in the google sheet
as shown in the Fig 3.
E. Cattle Activity Prediction algorithm
Let us have a deeper look into what happens in logistic Algorithm 1 Cattle activity prediction Algorithm
regression in this case:
1: Start
Logistic regression is a supervised learning algorithm that
2: Taking inputs
helps in binary classification by predicting the probability
3: A = probability of eating
whether a feature set belongs to a particular class or not. If the
4: B = probability of walking
probability of prediction is greater than 0.5 then the output will
5: C = probability of being stationary
be 1 otherwise the output will be 0. In this case we have three
6: if A ≥B and A ≥C then
classes viz.,eating, stationary, walking. As logistic regression
7: print(Activity = “Eating”)
is used only for binary classification we use one vs all i.e.,
8: else if B ≥C and B ≥A then
the algorithm finds the probability of each of the three classes
9: print(Activity = “Walking”)
against the remaining two and predicts the activity as the one
10: else if then
which has the highest probability. To find the probability of
11: print(Activity = “Stationary”)
an activity the algorithm uses a logistic function,
4
Authorized licensed use limited to: Universitas Brawijaya. Downloaded on October 21,2024 at 22:49:48 UTC from IEEE Xplore. Restrictions apply.
The flow of data from sensors to alerting the cattle owner TABLE II
when temperature and pulse values are above set threshold and C OMPARISION WITH OTHER A LGORITHMS
predicting the cattle activity is as shown in the Fig 5.
The graphs plotted for each activity is as shown in the Fig 6. Algorithm Accuracy Precision F1 score
These are the observations of the accelerometer values along Logistic Regres- 91.46% 0.96 0.92
sion
3 directions namely x, y and z axes of the cattle during its Support Vector 87.80% 0.95 0.90
activities of eating, being stationary and while walking. Machine
K nearest neigh- 89.02% 0.96 0.91
bours
a)
for better understanding of number of hours spent by the cattle
in each activity as shown in Fig 9. The experimental results
are analysed and presented in the form of confusion matrix
shown in Fig 8 for the prediction of activities. The accuracy,
precision and F1 scores of the model when predicted using
algorithms like SVM and KNN are as shown in the following
table II.
V. C ONCLUSION AND F UTURE S COPE
The final analysis of this paper is that this prototype is easy
to use and successfully tracks the health parameters of the
b)
cattle and predicts their activity and sends an email to the
owner of the cattle if the values of temperature and pulse
values are above the set threshold values so that he/she can
take proper care of their cattle. This can be further developed
by by the following ways:
• Database Management System can be used to store data
in a structured manner on a daily basis so that we can
have the information of the cattle on any particular day.
• A webpage can be created for the cattle owner can store
all the information at one place for each cattlel.
• Using better visualization techniques and tools which is
c)
easier to understand.
&$77/($&7,9,7< ,1+2856
($7,1*:$/.,1*67$7,21$5<
IV. E XPERIMENTAL R ESULTS A ND A NALYSIS
The graphs produced from the readings during field de- Fig. 9. Bar Plot of Cattle Activity in 15 Hours
ployment are given in Fig 7. The readings collected from the
temperature sensor and pulse sensor are plotted as a graph for R EFERENCES
clear analysis. The 3D printed case is wound over the neck of [1] L. Madhusudhan, “Agriculture role on Indian economy,” Bus. Econ. J.,
the cattle so that the pulse sensor touches to its nerve and the vol. 6, no. 4, p. 1, 2015.
temperature sensor touches to its body in order to get accurate [2] P. S. Chatterjee, N. K. Ray and S. P. Mohanty, ”LiveCare: An IoT-
Based Healthcare Framework for Livestock in Smart Agriculture,” in
values. The predictions made by CAP Algorithm are also given IEEE Transactions on Consumer Electronics, vol. 67, no. 4, pp. 257-
in Fig 7. These predictions are plotted in the form of bar graph 265, Nov. 2021, doi: 10.1109/TCE.2021.3128236.
5
Authorized licensed use limited to: Universitas Brawijaya. Downloaded on October 21,2024 at 22:49:48 UTC from IEEE Xplore. Restrictions apply.
Fig. 7. Graphical plot of Sensor Readings
6
Authorized licensed use limited to: Universitas Brawijaya. Downloaded on October 21,2024 at 22:49:48 UTC from IEEE Xplore. Restrictions apply.
Cattle health monitoring system using IoT,” J. Netw. Commun. Emerg.
Technol., vol. 7, no. 8, pp. 19–23, 2017.
[17] M. Meenakshi and S. S. Kharde, “Advanced cattle health monitoring
system using Arduino and IoT,” Int. J. Adv. Res. Elect. Electron.
Instrum.Eng., vol. 5, no. 4, pp. 3365–3370, 2016.
7
Authorized licensed use limited to: Universitas Brawijaya. Downloaded on October 21,2024 at 22:49:48 UTC from IEEE Xplore. Restrictions apply.