Animal Intrusion Detection System Using CNN and Image Processing
Animal Intrusion Detection System Using CNN and Image Processing
ISSN No:-2456-2165
Abstract:- One of the greatest dangers to agricultural (ANN) to help farmers overcome their ordeal and improve
productivity is animal damage to agriculture. Crop accuracy in identifying plant diseases.
raiding has become one of the most antagonistic human-
wildlife conflicts as cultivated land has expanded into On the other hand, the precision of such systems is
previous wildlife habitat. Farmers in India endures major heavily reliant on feature selection methodologies. With the
risks from pests, natural disasters, and animal damage, all elimination of image pre-processing and the facilitation of
of which result in lesser yields. Traditional farming intrinsic feature selection, convolutional neural networks
methods are unsuccessful and hiring guards to watch have recently made significant progress in automated image
crops and keep animals at bay is not a practical solution. recognition. The availability of a large enough dataset for
It is critical to protect crops from animal damage while such competitions is another problem. In situations when
also redirecting the animal without injuring it, as the there is a lack of data, it is best to utilise a model that has
safety of both animals and people is essential. To get over already been trained on a big dataset. Transfer learning is used
these obstacles and accomplish our goal, we employ the to develop a model that is then fine-tuned to adapt the final
deep learning concept of convolutional neural networks, a layers to make them unique to the dataset at reference.
subfield of computer vision, to identify animals as they
enter our farm. The primary goal of this project is to However, the precision of such systems is significantly
constantly monitor the entire farm using a camera that influenced by feature selection procedures. Convolutional
records the surroundings at all hours of the day. We neural networks (CNNs) are a kind of neural network that
significantly improves image-based recognition by doing
identify animal infiltration using a CNN algorithm
and Xgboost and notify farmers when this occurs. away with the need for picture pre-processing and allowing
intrinsic feature selection. Another difficulty is acquiring a
Keywords:- CNN, XGBoost, Computer vision. large dataset sufficient for these contests. When the dataset
size is limited, it is better to use a model that has been pre-
I. INTRODUCTION trained on a large dataset. This is known as Transfer Learning.
The dataset was developed to help with animal spotting using
A. GENERAL INTRODUCTION information gathered over the course of many months.
In India, agriculture plays a key role. In India, agriculture Various animal images are used for the detection of the
has always been a major contributor to the country's GDP. intrusion in farming fields, for the training the model.
The majority of Indians find work in agriculture, yet this
sector is filled with challenges. Animal-human conflict has CONVOLUTIONAL NEURAL
long been a big problem that has wasted countless resources NETWORK
and put people's lives in danger. In recent years, there has One kind of ANN is the convolutional neural network
been an increase in the frequency of these sorts of conflicts. (CNN). Since it is optimised for handling data in pixel
Therefore, this area needs continual surveillance to deter the format, it may be used for image recognition and
introduction of such animals and other undesirables. processing. It has multiple layers to process the data
Encroachment and poaching lead to human-animal conflicts and extract important features from the grid like
because people go into the forest for subsistence, claiming arrangement.
land for agricultural practises and fast industrialisation leads
the growth of urban ground, while animals approach CNN saves a lot of time and also reduces errors.
surrounding villages in search of water during the dry Since, it doesn’t need more parameters for learning the
summer months. Elephants and wild boars often trample characteristics of image filters. The main purpose of
agricultural plants in their hunt for food. When one species the CNN algorithm is to extract image features without
needs something, it might threaten the survival of another, losing the data it represents. CNN is based on
depleting resources and sometimes claiming lives. South Asia neuroscience findings and is made up of artificial
and Africa are the most common regions where people and neurons.
elephants come into conflict with one another. In most cases,
an electric fence is used to keep animals out of a farm's crops. Usually for image processing through CNN, if an
The address situations the animals to act in an odd manner, image is given then it takes pixel values as data and
making them easier to capture. Deep learning strategies are picks some visual features. It points out the pixel
required to avoid these types of issues. Researchers used values of colors for the activation function.
various machine learning strategies similar to the Support
Vector Machine (SVM) and Artificial Neural Networks
A. TRAINING IMAGES:
The training images is done to obtain the images of
animals and train the own database set. By this the animals
which intruded into farming fields are detected through
Fig. 1: CNN model cameras located on the fields. Here various animals which are
B. OBJECTIVES common for the field intrusion are considered such as deer,
The goal of the project is to give security against wild cows, wild boar, elephants, monkeys etc. Kaggle is used for
animal attacks, ultimately decreasing the farmer's potential downloading image dataset for detection of animal intrusion.
loss. B. DATA AUGMENTATION
Detecting intrusions in the field. Using a process called data augmentation, fresh training
Capturing the intruder's image and identifying it using data may be produced from existing data. It helps prevent
image processing. machine learning models from being overfit during training
Contrasting the image with an image of an animal. by acting as a regularizer. Here in animal intrusion detection
Taking appropriate response based on the type of intrusion. large datasets are considered for training as such the data
augmentation leads to better prediction accuracy. While the
II. LITERATURE REVIEW process is operating, it has no effect on the size of the test
sample. Data augmentation uses the techniques such as
There is some related work that apply deep learning
position, scaling, cropping, padding, brightness etc., by these
methodology for detection of animal intrusion such as
the diversity of data within available is increased. Here data
Prakash, Banupriya[1] they describe a focused literature
augmentation is performed for the animal image data training
about the algorithm that classifies based on their image, so we
and prediction.
can effectively guide them. Animal detection and
classification may assist to avoid the accidents, track animals C. CNN CLASSIFICATION
and prevent theft. Nagaraju Andavarapu and Valli Kumari Convolutional neural network (CNN) classification is a
Vatsavayi[2] it states that WCoHOG is a Histogram oriented form of deep neural network used for image classification and
gradient based feature vector with improved accuracy. It is an computer vision applications. CNN's key benefit over its
expansion of Co-occurrence Histograms of Oriented forerunners is that it can recognise key traits automatically,
Gradients (CoHOG). LIBLINEAR classifier is used in order without human intervention. Convolutional neural networks
to get better accuracy for large dimensional data. (ConvNets) are both more effective and less asset than
traditional methods for machine learning. Here Two stage
S. Yadahalli, A. Parmar and A. Deshpande[3]Here
CNN is used such as binary level classifier and multi-level
various sensors and cameras are interfaced with the board
classifier. It is a supervised learning model which can
such as Passive Infrared Sensors(PIR), the camera capture the
differentiate various objects sizes, color in a single image.
intruding image with TFT display. Gyanendra K. Verma and
Return of Image pooling with XGboost is performed for the
Pragya Gupta [4] The multilayer graph cut in the spatial-
animal intrusion detection.
temporal domain was applied to a camera-trap database
including prospective animal suggestions. These are put to
use in the verification stage, which determines whether or not
a particular patch represents an animal.
utilised multiple times, they result in a Deep Neural − ∑ 𝑦𝑖 . log(𝑝(𝑦𝑖 )) + (1 − 𝑦𝑖 ). log(1 − 𝑝(𝑦𝑖 ))
𝑛
Network's path of action. There are three basic types of layers 𝑖=1
used to construct a CNN: Constructed trees and models are used to get all of the
Information: This layer contains the image's incorrect potential solutions to the equation F2(x) =
pixel estimations. (0+1*h1(x)+1*h2(x)), where the final value of F2(x) is the
Convolutional Layer: This layer receives the results of the XgBoost model prediction, if we are interested in creating a
neuron layer, which is linked to the data district. In this prediction for a new data point.
layer, we illustrate the degree of wreckage. Each channel
may be a 5x5 window that slides through the data and V. RESULT
selects the pixel with the highest striking power as the
yield. Our model has been trained by using Multistage CNN
Modified Linear Unit [ReLU] Layer: This layer handles with LBP histograms and XGBoost gradient. Login page and
picture data in a region-wise manner. We like that a CNN registration page is created for the farmers for registering
employs back increase. Designers use the ReLU work to their details and when the animal is detected of intrusion in
maintain proportional estimations of the pixels while not the farming fields. The mail and alert notification is sent to
being affected by the back starting. the farmer. The Kaggle website is used for the image dataset
Pooling Layer: This layer performs a down-testing work for detecting animal intrusion. The MySQL is used for the
along the spatial estimations (width, stature) in order to details storage of users and Tkinter is used as its frontend.
achieve volume.
Totally Connected Layer: This layer is utilised to select
the score classes, i.e. which class has the best score when
compared to the data digits.
B. LBP:
To assign labels to picture pixels, Local Binary Pattern
(LBP) thresholds the area around each pixel and treats the
output as a binary number. To extract hierarchical data
representations, deep learning is widely used. The Local
Binary Pattern Network (LBPNet) is presented as a means of
efficiently collecting and comparing high-level over-
complete features in a multilayer hierarchy. Fig. 3: Home page