Professional Documents
Culture Documents
destroy the crops in agriculture land and farmers are suffer in huge level. This
is to prevent these type of attack from the animals in agriculture land with the
help of certain sensors and buzzer compounds. The machine learning runs the
yolov3 darknet is a convolutional neural network that acts as a backbone for the
YOLOv3 object detection approach. These camera and sensor detects the
moment of animals in agriculture land if it detects the animals then sends the
alert message to the farm owners. And also make a sound to clear the animals in
farm, the sound is differ for each animals. The sound is depend on the animal
which cause damage in the agriculture area. The animal is detected by a sensor
and identified through the pre-loaded data sets in a raspberry pi and the certain
sound is made and also sent the alert notification along with the animal which
cause attack in agriculture land. The farmer can stop the buzzer sound through
IoT (Internet of Things) controls the Things that are connected to it and
transfers the data over the network. The IoT technology enables the collection
of real-time data from the farm field using Sensors and various electronic
components . In this work, we present the coordination of Pi Camera, LED, and
Buzzer interacting with the cloud a new service in the domain. The peripheral
part adopted wireless technologies such as WiFi for cooperating with the data
center by an advanced IoT gateway. Pi Camera is used to capture real-time
images in a farm field 24 × 7 i.e., day and night. The low cost and ease of
programming controller Raspberry Pi for coordination of hardware part and data
transferred through ESP8266 WiFi module, which uses TCP/IP protocol
The main scope of this project is to develop an animal which cause the
damage agriculture land .The design system will not be dangerous to animal and
human being, and it protects farm.
To protect the plants in agriculture land from the birds and animals, then
to video display units the agriculture area to prevent from the outside attacks
through animals and want to send the information to the farm owner .And the
immediate action to be taken for reduce the attack from the animals and also
now no longer to damage the animals physically.
CHAPTER 2
LITERATURE SURVEY
2.1 Introduction
The various research works on the existing animal detection model using
IoT are discussed and analysed.
1. TOPIC: Automatic Tracking and Alarm System for Eradication of Wild
Life Injury and Mortality
AUTHOR: Nirit Datta and Souvik Sarkar
This paper report explains the methodology to overcome the problem of human
and animal injury and mortality due to the straying of wild animals out of the
national parks and wildlife sanctuaries by the use of automatic tracking and alert
system. Automatic tracking and alert system has been implemented by
incorporating GSM and GPS technology in the form of a device that would be
attached to the body of an animal and would be continuously monitoring the
position of the animal with respect to the GPS defined boundaries set up inside
a wildlife sanctuary or national park. In case an animal strays out of the GPS
defined zone, an alarm system that will be installed in a human populated zone
will go off, informing people about the approaching danger. This system is
flexible, cost effective and easy to implement and can be beneficial for
monitoring wildlife related complexities like poaching, railway and roadway
accidents, train delays, destruction of vegetation and threat to human life on the
occasion of straying of wild animals out of their habitation zone.
2. TOPIC: A Practical Animal Detection and Collision Avoidance System
Using Computer Vision Technique
AUTHOR: Sachin umesh sharma and dharmesh j. Shah
One serious problem that all the developed nations are facing today is death and
injuries due to road accidents. The collision of an animal with the vehicle on the
highway is one such big issue, which leads to such road accidents. In this paper,
a simple and a low-cost approach for automatic animal detection on highways
for preventing animal-vehicle collision using computer vision techniques are
proposed. A method for finding the distance of the animal in real-world units
from the camera mounted vehicle is also proposed. The proposed system is
trained on more than 2200 images consisting of positive and negatives images
and tested on various video clips of animals on highways with varying vehicle
speed. As per the two-second rule, our proposed method can alert the driver
when the vehicle speed is up to 35 km/h. Beyond this speed, though the animal
gets detected correctly, the driver does not get enough time to prevent a
collision. An overall accuracy of almost 82.5% is achieved regarding detection
using our proposed method.
3. TOPIC : IoT based animal tracking and monitoring system in Zoo
AUTHOR: R.Shanmugasundaram and S.Pavithra
The goal of this project is to track the location of Animal in the zoo or national
parks. This system would include a temperature sensor and PIR sensor. The
temperature sensor senses the temperature of each animal and PIR sensor senses
the human presence inside the animal boundaries or restricted areas. Generally
every animal having particular range of body temperature. If the animal having
any wounds or fever, the body temperature will be automatically increased. To
monitor this, we are using temperature sensor. It continuously monitors the
animal‟s temperature. If any variation in the temperature, It will be displayed on
the LCD. The PIR sensor is used to monitor the human presence in restricted
areas or nearby the animal boundaries. When the human presence is detected,
the voice processor will give alert to the people through the pre-recorded voice.
The GPS receiver send the location, animal temperature to the controller and it
is interfaced with the IOT, It will give the complete information to the website
on PC or laptop
4. TOPIC: Animal Intrusion Detection System Using Wireless Sensor
Networks
AUTHOR: Dr. P. Uma Maheswari and Anjali Rose Rajan
The animal intrusion detection system is incredibly essential in numerous fields
like villages close to forests, roads through forests and agricultural fields.
Attacks from animals area unit common all told these fields. A system is created
victimization sensors to notice the tress passage of those animals. It helps to
induce privy to the encroaching of untamed animals and birds. The system for
birds is that the acoustic sounds area unit made within the encompassing area
factor of the agricultural fields wherever the arrival of birds area unit detected
and therefore the birds are unbroken removed from the realm. Once the
associate degreeimals arrive or trespasses an alert message is provided to few
individuals within the needed space who will lead the individuals around from
destruction. And that they can also take necessary actions to stop attacks of the
trespassers. Applications that area unit vital area unit preventing animal
bumping to vehicle on roads, preventing dangerous animal intrusion in
residential district, knowing locomotive behavioral of targeted animal and lots
of additional. Within the agricultural areas placed close to the forest several
animals destroys the crops or perhaps attack on individuals so there's a desire of
system that detects the animal presence and offers warning this within the read
of safety purpose. During this project the aim is to notice the animals who
crossing their boundary and offers the attentive to the system to require sure
action
5. TOPIC: A Literature Survey on Animal Detection Methods in Digital
Images
AUTHOR: Boon Tatt Koik and Haidi Ibrahim
Animal detection based researches are useful for many real life applications.
Animal detection methods are helpful on the research related to locomotive
behavioral of targeted animal and also to prevent dangerous animal intrusion in
residential area. There are a few branches of research related to animal
detection. Therefore, this paper will survey some of these branches. Researches
regarding animals in image processing have been an important field to
numerous applications. Many algorithms and methods have been developed by
human being in order to have a better understanding on animal behaviour.
Besides, these applications also can act as a warning system to human being
from intrusion of dangerous wild animal for early precaution measures. These
applications can be narrowed down to three main branches, namely detection,
tracking and identification of animal. This paper will give more attention and
review for animal detection methods. The review also limited to the methods
that use digital images or digital video. This review will be given in the next
section.
6. TOPIC: Moving object detection based on background extraction
AUTHOR: C. Peijiang
Moving object detection is a very important research topic of computer vision
and video processing areas. The process of moving object detection based on
the background extraction is divided into two steps, background extraction and
moving object detection. Improved method of obtaining background image
based on common region is cited. The basic idea is to capture a series of video
pictures of the scene at regular intervals, the picture is divided into of m*m
blocks which expectation and variance are calculated respectively to describe
the vector information of the region. A new acquiring threshold method is
brought forward when extracting the moving object. The arithmetic mean of
original iterative method is replaced by weighted mean and the average gray of
the foreground is higher than the average gray of background. Then, the
threshold is also increased to some extent. The introduction of the smoothing
coefficient can avoid the mutation of current threshold. The experiments show
that the scheme can realize the moving object detection effectively, and it has
high definition.
7. TOPIC: A dynamic RFID-based mobile monitoring system in animal care
management over a wireless network
AUTHOR: J. S. L. Ting, S. K. Kwok, W. B. Lee, H. C. A. Tsang, and B. C. F.
Cheung
Due to the increasing integration of animals into family lifestyles, animal care
management becomes an important issue as animals have a direct impact on
human psychological and physical health. Even though there are a lot of
solutions, maltreatment of animals and risks in animal health are increasing as
indicated in the newspapers and statistics. In addition, many identification
methods are not efficient and user-friendly. In this paper, an RFID-based mobile
monitoring system (RFID-MMS) is designed in helping users to better manage
the animals in dynamic information retrieving, location tracking, and behavior
analyzing over a wireless network. The proposed system, which is suitable for
using in all animals unities, enhances the companionship between humans and
animals.
2.2.EXISTING SYSTEM:
Raspberry pi4 is used to run a machine learning algorithm. Pi cam is used to
capture the intruder images entering the agricultural field. The images are then
analyzed by the machine learning algorithm running on the Raspberry pi board
and conclusions are drawn as an output of machine learning algorithm. If any
danger is sensed the Raspberry pi generates sounds of different frequencies with
the help of a buzzer and an input signal is sent to ESP8266 nodemcu which is in
communication with the firebase IoT cloud which sends messages to the farmer
through the android application . If the intruder is detected at night, the LED
lights and buzzer are triggered simultaneously to divert the intruder away from
the field.The module is made to identify the animals and start the buzzer sound
to alert farm owner.It helps the farm owner to know the incident took place in
their farming land and the measures can be taken.
CHAPTER 3
PROPOSED SYSTEM
3.1 PROPOSED SYSTEM:
The proposed model consists of two parts as Hardware and Software.
Raspberry pi acts like a heart for the hardware part and it is interfaced with
components like a voltage regulator, Pi Camera, WiFi, and Buzzer
The software part for the hardware is done through ANDROID application
animal prediction used machine learning models like darknet yolo v3 for object
detection and predicts the animals issue we proposed to designed a system
audio recorder and player is fixed the sound is differ for each animals. The
sound is depend on the animal in which sound is played. So that wild animals
will not enter into the farm. It will run away.
CLASSIFICATION OF CLASS MODEL
fig 1: classification of class model
WORKING
Our project aim to detect two type of animal, elephant and wild pig. These two
animals are entirely collapse the agri land and products. So our system used
surveillance based animal detection to avoid these kind of disasters
3.2 MODULES:
They are four modules
Detection Module
Alarm Module
Connectivity Module
Message Module
Source: Wikipedia
Convolutional neural networks (CNN) are deep artificial neural networks that
are used primarily to classify images (i.e. label what they see), cluster them by
similarity (i.e. photo search), and perform object recognition within scenes.
They are algorithms that can identify faces, individuals, street signs, cars,
animals, anomalies, tumors and many other aspects of visual data.
Convolution layers are used to extract the features from input training samples.
Each convolution layer has a set of filters that helps in feature extraction. In
general, as the depth of CNN model increases, complexity of features learnt by
convolution layers increases. You can learn more about CNN
at here, here or here. Andrej Karpathy has written a great write up at
this link for his earlier Stanford CNN course if you would like to academically
go deeper.
The input image is divided into an 7 x 7 grid. Then bounding boxes are
predicted and a class is predicted among classification over the most confident
ones.
YOLO V2 is trained with the COCO (Common objects in Context) library that
has 100k images of 80 common classes plus it is complemented with a subset of
ImageNet. It has 80 image classes. As a reference ImageNet has 14 million
images and 22k classes. You can leverage other data sets or leverage Amazon
mechanical Turk like new crowd sourcing services for manual labeling work
and come up with your own data set!!
All code and environment is open source thus anyone can clone and modify the
work. I also made a small Python code modification to be able to use an
external webcam for my real time recording convenience while making my test
YouTube videos (so as not to carry my laptop around). You can do any editing
as long as you know some Python and understand the theory to some degree…
Most of the examples on the web are usually based on Linux or Mac though I
had to make this demo on my Lenovo Windows 10 machine with Intel core7.
Thus all below personal experience & guidance is fit for use on a Windows
environment.
Original YOLO authors created DarkNet in an OpenSource library using C and
CUDA. I chose to use Darkflow instead which is basically a translation of
DarkNet to the convenient Tensorflow version. Thus we will download and use
the DarkFlow version for this demo.
OK let’s get started… Dependencies
You need to have Python 3.5 or 3.6, Tensorflow, numPY, openCV on your
(laptop) environment to get started. Below is some guidance that has worked for
me on Windows.
Step 1 — Install the dependencies for Windows
For beginners you can install the following to have a clean slate of ready-to-go
personal computing environment for your future ML experiments.
1. Download & install Anaconda package 64-bit version and choose
the Python 3.6 version. (link to video tutorial) This automatically installs
Python and many popular data scientist/ML libraries (NumPy, Scikit-
Learn, Pandas, R, Matplotlib…), tools (Jupyter Notebook, RStudio) and
hundreds of other open source packages for your future projects. When
you start out, it feels like the closest thing to the holy grail of ML
packages… For example I still use the Anaconda Jupyter Notebook for
almost all my ML experiments mostly out of
convenience. openCV library is not included though and we will install it
separately as it is needed for real-time computer vision tasks. (Hint for
Anaconda folks!)
2. Install Tensorflow and Keras (optional). TensorFlow is the most popular
AI software library and is created/maintained by Google. Keras is another
highly popular & high-level neural networks API, written in Python and
capable of running on top of TensorFlow. It was developed with a focus
on enabling fast experimentation. When you feel like “quitting” after
going thru Andrew Ng ’s like really low level material, Keras feels like a
piece of cake! Because it is a high level language based on
Python. Someone else has done the hard work for you!
It is common to have issues while trying to install all these open source
packages especially if you are on a Windows machine. It takes a while to make
everything work and resolve all the version or conflict issues. My best practice
is to basically Google such issues and find solutions online. Websites
like stackoverflow are super helpful and save your time & sanity!
In general, I also find helpful to create a separate new conda virtual
environment to mitigate the Windows installation issues. More on that here.
Step 2 — Install the DarkNet/YOLA, Darkflow stuff
DarkNet: Originally, YOLO algorithm is implemented in DarkNet framework
by Joseph Redmon. Darknet is an open source custom neural network
framework written in C and CUDA. It is fast, easy to install, and supports both
CPU and GPU computations. You can find the open source on GitHub.
Darkflow: It is a nickname of an implementation of YOLO on TensorFlow.
Thanks to Trinh Hoang Trieu, Darknet models are converted to Tensorflow and
can be installed on both Linux and Windows environments. Lets do it!
# Open your anaconda prompt and clone the darkflow github repository. (You
may need to install Git Bash Windows for git command to work)
git clone https://github.com/thtrieu/darkflow
# Alternative is to basically go to the DarkFlow GitHub page and download
the master repository to your local (i.e. C:\users\user_name\darkflow)
# If you have not already created a new virtual environment in Step 1, then
create a conda environment for darkflow installation.
conda create -n your_env_name python=3.6
# Activate the new environment using anaconda prompt.
activate your_env_name
# You can install the needed OpenCV with a conda-forge repository. conda-
forge is a github organization containing repositories of conda libraries.
conda config --add channels conda-forge
conda install opencv
# Build the Cython extensions in place. This is a widely used Python to C
compiler and wrapper that helps us to call the DarkNet C-code from Python.
python setup.py build_ext --inplace
or try the following as alternative
pip install -e .
If you get an error, try changing the working directory to darkflow (cd
darkflow) first and re-run one of the above commands.
Cool. The above steps will hopefully setup a local environment to run darkflow
and perform object detection task on images or videos.
Lastly we need to download the CFG and WEIGHTS files. The pre-trained
model name is YOLOv2 that is trained on a COCO image data set containing 80
classes (image types like car, dog, person, aeroplane etc).
WEIGHTS file: Please download the yolov2.weights file from here. Pls create a
darkflow/bin directory for keeping these weights file.
CFG file: Create a yolo.cfg text file of corresponding model in the
existing darkflow/cfg directory under your local darkflow folder. Check here for
the source file. You can copy paste the raw GitHub content with a notepad if
you want. Also do not forget to have a look at Darkflow's command line help
options for future reference.
python flow --h
PS: I found this blog (Abhijeet Kumar) very helpful while i was figuring out the
needed installations.
We are all set.
Lets run Darkflow YOLO command line to render some video!
I fancy using the Anaconda command prompt to execute the following
commands. You can find it from the Windows Start menu via searching for
“Anaconda Prompt”. In the prompt window, activate your new Tensorflow
virtual environment via “activate your_environ_name” command. Then execute
the “cd darkflow” command to change the current working directory to your
local Darkflow repository. Then you can try the following commands to start
running DarkFlow to process images & videos.
1. For processing existing images, you can run the following command:
python flow --model cfg/yolo.cfg --load bin/yolov2.weights --imgdir
sample_img
Pls note that darkflow/sample_img is a directory with sample photos.
2. For processing a video file, you can move the to-be-rendered video file under
master darkflow folder and then use the following command:
python flow --model cfg/yolo.cfg --load bin/yolov2.weights --demo
samplename.mp4
Hint: If you append “ — saveVideo” at the end, you can save the processed
video under master folder as well.
3. For rendering a real time streaming video via your laptop camera:
python flow --model cfg/yolo.cfg --load bin/yolov2.weights --demo camera
What is YOLO?
YOLO stands for You Only Look Once and is a real-time object detection
system.
How to use YOLO for inference
There are several ways of using YOLO, the original way, is through Darknet
itself.
To use darknet we will need to do it through the terminal, and it is pretty easy to
do it.
Below are the steps we will need to follow.
Step 1: Clone Darknet from Github
git clone https://github.com/pjreddie/darknet
The weights file is around 248 MB and it is not included in the repository so we
will need to download it from a different URL.
You can either download it with a browser, but I prefer to do it directly in the
console like this:
wget https://pjreddie.com/media/files/yolov3.weights
Either way, you do it just make sure to place the weights file inside the darknet
repository so we can refer to it easily in the next step.
Step 4: Run YOLO to detect objects in an image
Now the moment of truth, we will run darknet to detect objects in an image.
To do it just execute this:
This is the result, as you can see it contains the objects that were detected as we
can read in the terminal screenshot from above:
REFERENCE:
[1] Nirit Datta and Souvik Sarkar, “Automatic Tracking and Alarm System for
Eradication of Wild Life Injury and Mortality,” IEEE Conference, 2016.
[2] Sachin umesh sharma and dharmesh j. Shah, “A Practical Animal Detection
and Collision Avoidance System Using Computer Vision Technique,” Special
section on innovations in electrical and computer engineering education,”
September 27, 2016.
[3] R.Shanmugasundaram and S.Pavithra,, “IoT based animal tracking and
monitoring system in Zoo,” South Asian Journal of Engineering and
Technology , Vol.3, No.2, 2017.
[4] Dr. P. Uma Maheswari and Anjali Rose Rajan, “Animal Intrusion Detection
System Using Wireless Sensor Networks,” International
Journal of Advanced Research in Biology Engineering Science and Technology,
Vol. 2, March 2016.
[10] Hanshi Wang; Jingli Lu; Lizhen Liu; Wei Song; Zhaoxia Wang;
“Community Alarm System Design Based On MCU And GSM”
Year: 2015
[15] Dr. Wilson, “Electric Fence” Handbook of Texas, Project report published
by the Texas State Historical Association. August 4, 2011