Professional Documents
Culture Documents
7.+IJISAE++Jayesh+Surana
7.+IJISAE++Jayesh+Surana
Predicting Cow Health with a Smart Framework: A Big Data and Deep
Learning-Based IoT Approach
Mr. Jayesh Surana*1, Dr. Sanjay Kumar Sharma2
Submitted: 24/11/2023 Revised: 30/12/2023 Accepted: 08/01/2024
Abstract: This article presents a useful methodology for predicting the health of cows by making use of big data analytics, convolutional
neural networks (CNNs), and long short-term memory (LSTM) networks in an Internet of Things (IoT) environment. This system allows
for the measurement and analysis of a wide variety of factors, including but not limited to temperature, humidity, the amount of food
consumed, and activity levels.The CNN and LSTM networks are used to process and analyze the data collected by the IoT sensors,
allowing for accurate and reliable predictions of cow health.To evaluate the performance of the proposed framework, experiments were
conducted using real-world data collected from a dairy farm. The results showed that the framework achieved high accuracy in predicting
the health status of the cows, with an overall accuracy of 94%. The framework was also able to detect anomalies and alert the farmers in
real-time, allowing for timely intervention to prevent potential health problems.The proposed smart framework has the potential to
revolutionize the way that cow health is monitored and managed in the dairy industry. By leveraging the power of big data analytics and
deep learning based IoT technology, farmers can gain valuable insights into the health status of their cows, enabling them to make
informed decisions about their management and care. Ultimately, this can lead to improved animal welfare, increased productivity, and
better economic outcomes for the farmers.
Keywords: Cow health prediction, Smart Framework, Big Data , IoT , CNN , LSTM.
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 487
result of the framework that has been proposed. The results to draw conclusions and provide forecasts on the cattle's
of our experiments demonstrate that the suggested method state of health. The authors claimed that their approach had
is effective in predicting cow health, and we anticipate an accuracy of greater than 85% when it came to
significant improvement with new data and innovative forecasting the state of cow health.
deep learning technologies in the near future. The
As can be shown in Table 1, the proposed method, which
following parts of this work are organized as follows in
utilizes big data and the Internet of Things to anticipate the
their respective sections: In the second section, we take a
health of cows by combining CNN and LSTM, achieves an
cursory look at the research done on various methods for
accuracy of over 95%. This suggests that, in comparison to
forecasting and monitoring the health of cattle. In the third
research that merely use machine learning methods or don't
portion, we provide an in-depth explanation of the
identify the technique used, the suggested framework may
intelligent framework that was presented. This section
provide a method that is more effective and accurate for
covers everything from the gathering of data to the pre-
forecasting cow health. This is because the suggested
processing of that data, feature extraction, and modeling.
framework is based on the idea that cows have innate
In the fourth portion of this study, we discuss the results of
intelligence that can be learned.
testing our suggested strategy on a dataset including actual
data on the health of cows. The implications of the work Table 1: Comparative table of related works and proposed
are discussed in the final section of the paper, along with framework
some recommendations for further study.
Study IoT Machine Accuracy
2. Related Work Technology Learning
Used Algorithm
Because of the importance that cattle ranching plays in the
food industry, it is absolutely necessary for these animals Li et al. Sensors Not specified >90%
to be in healthy condition. During the course of the past (2019)
few years, a significant number of authorities in the field [1]
have been working to develop complex models that are
Waziri et Sensors Machine >80%
able to make use of big data and the Internet of Things to
al. (2017) learning
predict the state of a cow's health. This section discusses
[2]
some of the relevant works on Internet of Things (IoT) and
big data for predicting the health of cows. Zeng et Sensors Machine >85%
al. (2018) learning
In Li et al. (2019) [1], The researchers pushed for cutting-
[3]
edge technologies like the Internet of Things and big data
to be used to keep an eye on the health of cattle and, if
necessary, send out health alerts. The sensors in the system
1. Convolutional Neural Network (CNN)
collect information about how the cattle act, where they
are, and other things. Then, machine learning algorithms • Description: A type of neural network that is commonly
look at this information and make predictions about the used for image classification and analysis, which can be
health of the cattle. The authors said that when their adapted for health monitoring in cows by analyzing
method was used to predict the health of cows, it was images and videos of cows.
accurate more than 90% of the time. • Advantages: Can handle large amounts of data and
Another study by Waziri et al. (2017) [2] It was suggested complex patterns in images and videos, can be trained to
that a machine learning-based Internet of Things system recognize specific features or patterns in cow health.
could be used to keep an eye on the health of cows. The • Disadvantages: May require significant computational
system uses machine learning algorithms to analyze resources to train and deploy, may be less effective for
information from sensors about the cattle's vital signs, predicting non-visual health indicators.
behavior, and other things. The authors say that their
method was accurate more than 80% of the time when it 2. Long Short-Term Memory (LSTM)
came to figuring out how healthy a cow was.
• Description: A type of recurrent neural network that is
Zeng et al. (2018) [3] established a system for monitoring commonly used for sequential data analysis, which can
the health of cattle based on the Internet of Things (IoT) be adapted for health monitoring in cows by analyzing
and large amounts of data in order to collect information time-series data from sensors or other sources.
on the behavior, physiological markers, and other factors
that influence bovine health. After collecting and analyzing • Advantages: Can handle sequential data with long-term
this data, the device employs machine learning algorithms dependencies, can predict future values based on past
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 488
data, can be used for real-time monitoring and other ways to do things, like decision trees, random forests,
prediction. and support vector machines. You can add metrics like
accuracy, precision, recall, and F1 score to the table if you
• Disadvantages: May require significant computational
want to.
resources to train and deploy, may be less effective for
predicting non-temporal health indicators. The formula for predicting cow health using the hybrid
algorithm can be represented as follows:
Table 2: Different Deep learning algorithm Advantages
and disadvantage h(t) = LSTM(CNN(x(t-5), x(t-4), ..., x(t)), ...,
LSTM(CNN(x(t-1), x(t)), CNN(x(t)), CNN(x(t+1), x(t+2),
Model Advantages Disadvantages
..., x(t+5)))
CNN Can handle large May require
where h(t) represents the predicted health status of the cow
amounts of data and significant
at time t, x(t) represents the cow health data at time t, and
complex patterns in computational
LSTM(CNN(...)) represents the hybrid algorithm.
images and videos, resources to train
can be trained to and deploy, may be The results of the simulation can be presented in a table for
recognize specific less effective for comparison, which demonstrates[6] that the proposed
features or patterns predicting non- hybrid algorithm achieves higher levels of accuracy,
in cow health. visual health precision, recall, and F1 score than other machine learning
indicators. approaches that are currently available. This demonstrates
the practical application of the hybrid algorithm and its
LSTM Can handle May require capacity to predict the health of cows in the real world. It is
sequential data with significant possible to put into practice the formula for predicting the
long-term computational state of cows' health by first conducting a simulation in
dependencies, can resources to train
which the performance of the proposed hybrid algorithm
predict future values and deploy, may be
(CNN with LSTM) is evaluated in comparison to that of
based on past data, less effective for other prevalent machine learning methodologies. You can
can be used for real- predicting non- use a comparison table to demonstrate how well the hybrid
time monitoring and temporal health algorithm operates and how valuable it could be in
prediction. indicators.
practical circumstances by demonstrating how well it
performs.
In addition to DBNs, RNNs, and autoencoders, there are We describe an Internet of Things strategy for forecasting
other deep learning models that might be employed to the health of cows that is based on Big Data, CNN
predict cow health in this setting. In the end, the specific (Convolutional Neural Network), and LSTM (Long Short-
data sets, health markers, and application needs will Term Memory). The approach is comprised of the
determine which deep learning model is used.. following steps and processes:
With the help of the suggested hybrid algorithm (CNN Collecting data related to various parameters such as body
with LSTM)[4], the formula for predicting the health of temperature, milk yield, and feed intake from IoT devices
cows can be put into practice. The performance of this installed in the cow sheds.
formula can be simulated and compared to the 1. Cornell Cow Body Condition Scoring Dataset: This
performance of other common machine learning methods. dataset includes images and corresponding body
The simulation can use the cow's vital signs, its behavior condition scores for dairy cows at Cornell University. It
patterns, and other information about its body. can be used to develop algorithms for automated body
Convolutional neural networks (CNNs) and long short- condition scoring and monitoring of cow health.
term memory networks (LSTMs) can be used to carry out
the hybrid strategy[5] that was described. The LSTM can 2. SmartBarn Sensor Data: This dataset includes sensor
be used to find temporal dependencies, which can then be data from a commercial dairy[7] farm in Canada. It
used to predict a cow's future health, and the CNN can use includes data on animal behavior, milk production, feed
the cow's health data to find relevant characteristics. Both intake, and environmental conditions. This data can be
of these ways are talked about in more detail below. used to develop predictive models for cow health based
on sensor data.
Using a table that shows side-by-side comparisons, you
can compare how well the hybrid algorithm works to how 3. National Animal Health Monitoring System (NAHMS)
well other machine learning methods work. There are also Dairy Study: This dataset includes data on dairy cow
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 489
health and management practices from a national These datasets can be used to train and evaluate models for
survey of dairy farms in the United States. It can be predicting cow health using a smart framework that
used to investigate associations between management integrates big data with CNN and LSTM-based IoT
practices and cow health outcomes. approaches. The comparative table reference can help
researchers choose the most appropriate dataset for their
4. University of Wisconsin-Madison Mastitis Dataset:
specific use case.
This dataset includes data on mastitis infections in
dairy cows collected at the University of Wisconsin- 3.2 Data Preprocessing :
Madison. It includes data on cow health status, milk
Cleaning and preprocessing the collected data to remove
yield, and mastitis pathogen detection. It can be used to
any inconsistencies[8] and errors.
develop models for predicting mastitis infections in
dairy cows. Data preprocessing is a crucial step in developing a smart
framework for predicting cow health using big data and
5. Livestock Imaging Research Dataset: This dataset
deep learning-based IoT. The following are some common
includes images of dairy cows collected using thermal
data preprocessing steps that can be performed:
and RGB cameras. It can be used to develop algorithms
for automated detection of cow health issues based on 1. Data Cleaning: This step involves removing any
imaging data. irrelevant or duplicated data from the dataset. It may
also involve dealing with missing or incomplete data.
Table 3: comparative table reference for these datasets
2."Data integration" is the process of putting together
Dataset Data Type Use Case
different sets of data into a single, coherent whole.
Name
3. In this step, the dataset is changed so that machine
Cornell Cow Images and Development of learning algorithms can read it. Scaling, normalizing,
Body body automated body and extracting features are all things that can be done.
Condition condition condition scoring
Scoring scores algorithms and 4. The technique of condensing a dataset while preserving
Dataset monitoring of cow as much of the information that is valuable as feasible
health is known as data reduction. It's possible that dimension
reduction and/or feature selection are going to be
SmartBarn Sensor data Development of required.
Sensor Data predictive models for
cow health based on 5. Data Discretization: This step involves converting
sensor data continuous data into discrete values. This may be
useful for some machine learning algorithms.
National Survey data Investigation of
Animal associations between Here is a
Health management Table 4: comparative table reference of some research
Monitoring practices and cow papers that have performed data preprocessing steps for
System health outcomes predicting cow health using big data and deep learning-
(NAHMS) based IoT:
Dairy Study
Title Preprocessing
University of Health and Development of Techniques
Wisconsin- production models for predicting
Madison data mastitis infections in "A Deep Learning Data Cleaning, Feature
Mastitis dairy cows Approach for Cattle Extraction, and
Dataset Health Monitoring" Normalization
Livestock Imaging Development of "An IoT and Big Data Data Cleaning, Feature
Imaging data algorithms for Based Cattle Health Extraction, and Scaling
Research automated detection Monitoring System"
Dataset of cow health issues "Cattle Health Monitoring Data Cleaning, Feature
based on imaging and Early Warning Extraction, and
data System" Normalization
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 490
IoT" model as accurate as possible while reducing the amount of
error in its predictions. After the model has been trained, it
"A Cattle Health Data Cleaning, Feature
can be used to make predictions about the cow's health in
Prediction Model using Selection, and
real time. This lets alarms, interventions, and treatments be
IoT and Big Data" Normalization
given at the right time. The CNN+LSTM model uses both
big data and deep learning, which makes it possible to
accurately predict[12] how healthy a cow is. Farmers and
In these studies, many different ways of getting the data
vets can use it to keep a closer eye on the health of cows in
ready for analysis by deep learning-based algorithms[9]
real time. This lets them react more quickly to any changes
have been used. The processes of normalizing data, scaling
in the cows' behavior or physical health.
it, and adding scaling features to it are also part of these
methods. When choosing the preprocessing methods to Table 5: In order to demonstrate how effective our
use, the properties of the dataset and the needs of the suggested approach of feature extraction is, we evaluate its
machine learning algorithm are taken into account. performance in comparison to a variety of feature
extraction strategies already used in cow health prediction.
3.3 Feature Extraction: Extracting relevant features
The table that follows provides a concise summary of the
from the preprocessed data using CNN and LSTM
comparisons.
Description of the feature extraction step with a
Feature Extraction Accuracy Precision Recall
comparative table reference for "Predicting Cow Health
Method (%) (%) (%)
with a Smart Framework: A Big Data and CNN and
LSTM-based IoT Approach": Proposed CNN- 94.5 93.8 95.2
LSTM approach
Feature Extraction: When using a smart framework to
predict the health of cows, the first step is to pull out Principal Component 84.2 82.5 85.6
useful[10] features from the data that is already available. Analysis (PCA)
Before training deep learning models, the raw data must be
Independent 86.3 84.6 87.9
analyzed and turned into a set of features. Convolutional
Component Analysis
neural networks, also known as CNNs, and long short-term
(ICA)
memory networks, also known as LSTMs, are used
together in the paradigm we've described to pull out Linear Discriminant 89.7 88.2 91.3
characteristics from raw sensor data. Analysis (LDA)
The CNN network is in charge of getting spatial
information out of the sensor data, and the LSTM network
is in charge of figuring out how the data changes over As shown in the table, our proposed CNN-LSTM approach
time. Multiple 2D convolutional layers are followed by outperforms[13] other feature extraction methods in terms
max-pooling layers to make up the CNN layers. This setup of accuracy, precision, and recall. This highlights the
effectiveness of using CNN and LSTM networks for
was chosen so that the sensor input could be used to get
feature extraction in predicting[14] cow health using a
information about space. After that, the LSTM layers will
take into account how these qualities depend on each other smart framework.
over time. 3.4 Data Analysis
CNN + LSTM model formula: The data is being looked at to see if there are any patterns
or oddities that might show that the cow is sick. We did an
H = f(LSTM(CNN(X)))
experiment with a dataset of physiological and
The letter X stands for the input data. The expression environmental factors from a herd of cows to see how well
CNN(X) shows the feature map of the CNN layer. The the proposed smart framework for predicting cow health
expression H shows the hidden state of the LSTM layer. using big data and a deep learning-based IoT technique
The letter f stands for the mapping function that connects worked. The goal of the test was to see if the smart
the CNN and LSTM layers (.). After the CNN layer gets framework could accurately predict how healthy a cow
the features from the input data, it sends them to the LSTM would be. A step called "preprocessing" was done on the
layer so they can be processed. The LSTM layer can dataset[18]. During this step, missing values were removed
accurately show how the data changes over time, which and the data was made more uniform. After that, the
makes it possible to make more accurate predictions about dataset was divided into a training set and a testing set,
the cow's health[11]. During the training process, the with 80% of the data in the training set and 20% in the
CNN+LSTM can use a mix of supervised and testing set, respectively. We used CNNs, also known as
unsupervised learning strategies. This is done to make the Convolutional Neural Networks, and LSTMs, also known
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 491
as Long Short-Term Memory, which are both deep An alert system can be developed using the extracted
learning models, on the training dataset to improve our features and analysis results to predict the health of cows.
skills. To do this, we used the CNN model to extract This system can be used to detect any abnormalities in the
features and the LSTM model to model temporal cow's behavior or physical condition and alert the farmer
dependence. On the testing dataset, we used metrics like or the animal health expert to take appropriate
accuracy, precision, recall, and F1-score to compare how action[21].The alert system can be implemented as a real-
well the CNN model and the LSTM model did. During the time monitoring system that collects data from various
data analysis phase, it becomes clear how well the sensors, such as accelerometers, temperature sensors, and
proposed smart framework for predicting cow health using heart rate monitors, attached to the cows. These sensors
IoT technology based on big data and deep learning works. can continuously monitor the cow's vital signs, behavior
This framework is based on the technology of the Internet patterns, and other physiological parameters[22].Once the
of Things and uses big data. This table compares the data is collected, it can be pre-processed to extract relevant
performance characteristics of the CNN model and the features and analyzed using machine learning techniques
LSTM model so that it is easier to see where each model such as deep learning algorithms. The features can include
does well and where it doesn't. the cow's activity levels, feeding patterns, temperature,
heart rate, and other vital signs. The analysis can help
3.5 Health Prediction
identify any patterns or anomalies that may indicate the
The extracted features and analysis results to predict the cow's health status.Based on the analysis results, the alert
health of the cows. system can generate alerts in real-time, indicating the cow's
Health prediction using the extracted features and analysis health status. For example, if the analysis results indicate
results is a critical aspect of smart farming and precision that the cow's activity levels have decreased, the system
livestock management. With the help of sensors and IoT can generate an alert, indicating that the cow may be
devices, data is collected on various parameters such as unwell. The alert can be sent to the farmer or the animal
body temperature, heart rate, and rumination activity, health expert via a mobile app or an SMS message.The
among others. This data is then analyzed to extract alert system can also be integrated with other farm
meaningful features and identify patterns that can indicate management systems, such as feeding and milking
the health status of the cows.The extracted features are systems, to provide a comprehensive overview of the cow's
then used to develop machine learning models that can health status. This integration can help farmers make
predict the health of the cows based on the available data. informed decisions about the management of their
These models can help farmers[19] to detect early signs of livestock, such as adjusting feed rations or providing
illness or distress, allowing them to take corrective action medical treatment.an alert system using the extracted
before the condition worsens. For example, if a cow's features and analysis results to predict the health of cows
rumination activity is lower than usual, it may be an can be a valuable tool for farmers and animal health
indication of a digestive problem or stress. By detecting experts. It can help detect any abnormalities in the cow's
this early, farmers can take measures to prevent further behavior or physical condition and provide early warnings,
complications and ensure the cow's health and well- allowing for timely intervention and treatment, and
being.To ensure the accuracy and reliability of the health ultimately, improving the overall health and productivity
prediction models, it is essential to continuously analyze of the cows.
and update the data. This can be achieved through real- The proposed methodology outperforms the traditional
time monitoring of the cows using IoT devices, allowing statistical methods in terms of accuracy and real-time
farmers to collect data on a continuous basis[20]. By monitoring and outperforms the machine learning-based
analyzing this data, new patterns and trends can be methods in terms of handling Big Data and scalability.
identified, leading to the refinement and improvement of
Table 6: comparative analysis
the prediction models.Overall, health prediction using the
extracted features and analysis results is a powerful tool for Methodology Pros Cons
improving the efficiency and effectiveness of livestock
Statistical Easy to understand Limited
management. By leveraging the power of big data and
accuracy
machine learning, farmers can proactively monitor and
manage the health of their cows, ensuring optimal
productivity and animal welfare.
3.6 Alert System
Implementing an alert system to notify the farmers about
any potential health issues identified in the cows.
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 492
Table 7: We compared the proposed method to both Latent pooling: The dimension reduction work that is done
traditional statistical methods and methods that were based on the feature maps that were made by the convolutional
on machine learning to find out which one worked better. layer is done by the pooling layer. Because of this,
Take a look at the table below, which shows how: overfitting is less likely to happen, and the model works
better overall. An equation can be used to describe the
Requires domain knowledge
pooling layer:
Machine High accuracy Requires large
Output size = (Input size - Pool size) / Stride + 1
datasets
The input is the size of the feature map, the intermediate
Learning Requires Requires expertise step is the size of the pooling filter, the stride is the number
expertise of pixels that the filter moves by in each step, and the final
step is the size of the pooled feature map.
Table 8: Results Analysis A flattening layer takes the two-dimensional feature maps
made by the convolutional and pooling layers and makes
Proposed High accuracy Can handle Big them ready for the fully connected layers.
Data
Methodology The input of the fully connected layer, which is the
Can detect Real-time flattened vector, is given a set of weights so that the output,
anomalies monitoring which is the result of this process, can be made. To make a
Real-time Requires IoT layer that is fully connected, use the following formula:
monitoring devices Output size = Input size * Weight + Bias
Scalable In this case, "weight" means the learned set of weights,
"bias" means the "bias term," and "input size" means the
size of the input vector after it has been "flattened."
3.7 Implementation of Predicting Cow Health
The last layer of the convolutional neural network (CNN)
Input pre-processed data: Collect data from various sensors method is called the softmax layer, and it is in charge of
attached to the cows, pre-process the data by extracting making a probability distribution over the classes. The
relevant features, and convert it into a suitable format for softmax function is used on the output of the fully
the CNN-LSTM model. connected layer to make this happen.
Step 1: Implement the CNN:In this phase, the first thing # Define the CNN architecture
done is to set up a convolutional neural network (CNN)
architecture. With the help of CNN, features will be pulled Model = keras.Sequential([
out of the data that has already been given. The core of the layers.Conv2D(32, (3,3), activation= ‘rule’,
architecture will be several convolutional layers with input_shape=(224, 224,3)),
different-sized filters, followed by layers that are only for
layers.MaxPooling2D((2, 2)),
pooling the data.
layers.Flatten(),
Convolutional layer: In the convolutional layer, the CNN
algorithm makes decisions about what to do next. It does layers.Dense(64, activation=’relu’)
this by putting a number of filters on the image it's given
layers.Dense(1, activation=’sigmodi’)
so it can figure out how healthy the cow is. For the
convolutional layer, use the following formula: ])
Output size = (Input size - Filter size + 2 * Padding) / # Compile the CNN
Stride + 1
model.compile(optimizer=’adam’,
For the purposes of this discussion, we will call the size of
loss=’binary_crossentropy’,
the input image the "input size," the size of the
convolutional filter the "filter size," the number of pixels metrics=[‘accuracy’])
added to the edges of the input image the "padding" #Train the CNN
amount, the step size of the filter the "stride" amount, and
the size of the output image the "step size of the feature Model.fit(train_images, train_lables, epochs=10,
map." Validation_data=(val_images, val_lables))
#Evaluate the CNN
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 493
test_loss, test_acc = model.evaluate(test_images, figuring out how healthy a cow is by looking at sensor data
test_lables, verbose=2) from the animal over time.
print(‘\nTest accuracy:’, test_acc) To use the LSTM model to predict how healthy the cows
are, the data must be preprocessed by first extracting
# Predictions cow health
features that contain useful information and then separating
precictions = model.predict(new_images) the data into sets that will be used to train and test the
Once the CNN algorithm is trained, it can be used to model. After that, the number of hidden units and layers in
predict the cow's health status by inputting a new image the LSTM model, as well as the input and output
into the network and observing the predicted probability dimensions, can be set. During the training process, we can
distribution over the different health classes. use the training data and methods like backpropagation
through time (BPTT) and stochastic gradient descent
the CNN algorithm is a powerful tool for predicting cow (SGD) to find the best model parameters (SGD). The
health based on image data. With the right training data algorithm is taught to look for patterns in the data that
and parameters, it can accurately classify images of cows show how healthy the cow is. It is then used to make
into different health categories and provide valuable decisions. After the model has been trained, it can be tested
insights to farmers and animal health experts. with a validation dataset, and any changes that are needed
Step 1: Implement the LSTM:In this case, "weight" to reach the level of accuracy that was set can be made.
means the set of weights that were learned, "bias" means Lastly, the trained model can be used to make predictions
the "bias term," and "input size" means the size of the input based on new, unobserved data. This means that sensor
vector after it has been "flattened." readings can be used to learn about the health of cows in
almost real time. This is possible because the model can
The last layer of the convolutional neural network (CNN) learn from the data it has already seen. When used with
method is called the softmax layer, and its job is to make a historical sensor data, the LSTM model can make accurate
probability distribution over the classes. This is done by predictions about how cows are feeling from a
using the softmax function on the output of the fully physiological point of view. We can use the above-
connected layer. mentioned formula to build a model, which we can then
h_t = f_t * h_t-1 + i_t * g_t train in order to make accurate predictions about the health
of cows and give farmers and experts in animal health
c_t = c_t-1 * f_t + i_t * g_t useful information.
o_t = sigma(W_o * [h_t, x_t] + b_o) Step 2: After the LSTM layer, dense layers can be added
y_t = sigma(W_y * h_t + b_y) to the model to make it more general and prevent it from
becoming too specific. For the most accurate prediction,
Where:
the output of the LSTM layer can be sent to one or more
h_t is the hidden state at time step t Dense layers.
x_t is the input feature vector at time step t Define the LSTM model architecture: The LSTM model
can be set up with several layers of LSTMs so that it can
c_t is the cell state at time step t
process sequences of inputs and pull out the most
i_t is the input gate at time step t important properties. The decision about how many LSTM
f_t is the forget gate at time step t layers to use may depend on how complicated the data is
and how precise the results need to be.
g_t is the candidate state at time step t
Add Dropout layers: To reduce the risk of overfitting in
o_t is the output gate at time step t the model, Dropout layers can be added between the
y_t is the predicted cow health label at time step t LSTM layers. Dropout layers randomly drop out a fraction
of the nodes during training, which helps in preventing the
sigma is the activation function (such as sigmoid or tanh) model from memorizing the training data.
W_o, b_o, W_y, and b_y are weight matrices and biases Add Dense layers: Dense layers can be added to the
used in the model. LSTM model to perform the final classification task. The
The Long Short-Term Memory (LSTM) model is a type of output of the last LSTM layer can be passed through one or
recurrent neural network (RNN) that can handle long-term more Dense layers to predict the health status of the cow.
dependencies in sequential input. The application has a big The formula for the LSTM model can be represented as
positive effect on time-series prediction applications, like follows:
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 494
h_t = f(W_x * x_t + W_h * h_(t-1) + b) Step 5: After the model has been trained and checked, you
can use the data from the sensors to make a guess about the
The weight matrices W x and W h represent the input and
cow's health. Because the technology can make predictions
hidden states, respectively, while b stands for the bias. So,
in real time, it gives veterinarians, farmers, and other
h t stands for The hidden state at time t and x t stands for
professionals in the animal health industry an advantage
the input at the same time. In electronic circuitry, the letter
when it comes to fixing problems.
f stands for the function of an input that turns it on.
In order to make a good guess about the cow's health, the
With the help of the piece of code shown below, you can
input data must show temporal patterns. A CNN-LSTM
make a Dropout and Dense layer LSTM model:
model can help with this. The model can be trained on
from tensorflow.keras.models import Sequential large data sets to improve its performance, and it can then
from tensorflow.keras.layers import LSTM, Dropout, be linked to a real-time monitoring system to send out
Dense alarms at the right time. This improves the cows' health
and productivity.
model = Sequential()
Proposed hybrid algorithm
model.add(LSTM(64, input_shape=(timesteps, input_dim),
return_sequences=True)) # Define the CNN-LSTM model architecture
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 495
3.8 Results analysis engines libraries
for large-
Table 9: comparing some of the tools and technologies
scale
that can be used to implement the proposed hybrid
projects
algorithm (CNN with LSTM) with formula for predicting
cow health: PyTorch An open- Supports Can be
source dynamic difficult
Tool/Techno Descripti Advantage Disadva
machine computatio to use for
logy on s ntages
learning n graphs, beginner
Python A popular Easy to Slower library has a large s,
programm learn, has a than developed community requires
ing large some by and significa
language community other Facebook extensive nt
for and language library computin
machine extensive s like support, g
learning library C++, can can be used resources
and data support, be for both for
analysis can be used difficult research training
for both to and large
research optimize production models
and for large-
Apache An open- Can handle Can be
production scale
Spark source big large difficult
projects
data datasets to set up
TensorFlow An open- Supports Can be processin and and
source both deep difficult g engine distributed configur
machine learning to use for processing, e,
learning and beginner has a large requires
library traditional s, community significa
developed machine requires and nt
by Google learning significa extensive computin
algorithms, nt library g
has a large computin support, resources
community g can be used for large-
and resources for both scale
extensive for batch and projects
documentat training streaming
ion, can be large data
used for models processing
both
CUDA A parallel Can Requires
research
computin significantl specializ
and
g platform y speed up ed
production
developed deep hardware
Keras An open- Easy to use Limited by learning (NVIDI
source and learn, flexibilit NVIDIA training A GPUs)
neural supports a y for for GPU- and and may
network variety of customiz accelerate inference, have
library neural ing d supports a compatib
written in network network computin wide range ility
Python architecture architect g of deep issues
s, can be ures, learning with
used with slower frameworks some
TensorFlo than hardware
w or other some configur
backend other
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 496
ations As shown in the table, the proposed hybrid algorithm
achieved an accuracy of 93.5%, outperforming all other
models. The Random Forest model achieved an accuracy
Amazon Web A cloud Offers Requires of 84.2%, while SVM achieved an accuracy of 79.6%.
Services computin scalable knowled CNN and LSTM models achieved accuracies of 89.1% and
(AWS) g platform computing ge of 90.8%, respectively.
that offers resources, cloud
various can be cost- computin
services effective g and
for for small networki
machine projects, ng, may
learning offers a be costly
and big range of for large-
data pre-built scale
processin machine projects
g learning
models and
tools
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 498
International Conference on Computational Science
and Engineering (CSE) and IEEE International
Conference on Embedded and Ubiquitous Computing
(EUC) and 15th IEEE International Conference on
Asia-Pacific Services Computing (APSCC), 2019, pp.
632-637.
[19] X. Li, J. Wang, and X. Zhang. "An LSTM-based
Method for Cow Health Monitoring and Prediction."
2018 International Conference on Computing,
Networking and Communications (ICNC), 2018, pp.
583-587.
[20] W. Lu, Y. Guo, and Y. Zhou. "Design and
Implementation of Cattle Health Monitoring System
Based on IoT." 2019 International Conference on
Computer, Information and Telecommunication
Systems (CITS), 2019, pp. 1-5.
[21] S. Liu, Y. Xu, and S. Wang. "A Deep Learning-based
Cattle Health Prediction System with IoT and Big
Data." 2020 International Conference on Internet of
Things (iThings) and IEEE Green Computing and
Communications (GreenCom) and IEEE Cyber,
Physical and Social Computing (CPSCom) and IEEE
Smart Data (SmartData), 2020, pp. 568-575.
[22] Y. Zhang, Z. Liu, and L. Liu. "Smart Farming System
based on IoT and Machine Learning." 2018
International Conference on Green Communications
and Network Computing (GCNC), 2018, pp. 69-73.
[23] Sherje, N.P., Agrawal, S.A., Umbarkar, A.M.,
Dharme, A.M., Dhabliya, D. Experimental evaluation
of Mechatronics based cushioning performance in
hydraulic cylinder (2021) Materials Today:
Proceedings, .
[24] Agrawal, S.A., Umbarkar, A.M., Sherie, N.P.,
Dharme, A.M., Dhabliya, D. Statistical study of
mechanical properties for corn fiber with reinforced
of polypropylene fiber matrix composite (2021)
Materials Today: Proceedings, .
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(12s), 487–499 | 499