0% found this document useful (0 votes)
130 views

Animal Intrusion Detection Using ESP32 Cam and Open CV

In forest and agricultural field human and animal conflict is a major problem where enormous amount if resources are lost and human and animal life are endangered. Due to this animal lives are endangered. People lose their crops, cattle and in some extreme cases they lose their lives. In current era of continuously developing IOT sensors and cloud technology, Image processing in remote areas became easy and cheap.
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)
130 views

Animal Intrusion Detection Using ESP32 Cam and Open CV

In forest and agricultural field human and animal conflict is a major problem where enormous amount if resources are lost and human and animal life are endangered. Due to this animal lives are endangered. People lose their crops, cattle and in some extreme cases they lose their lives. In current era of continuously developing IOT sensors and cloud technology, Image processing in remote areas became easy and cheap.
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/ 4

Volume 8, Issue 10, October – 2023 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Animal Intrusion Detection Using ESP32 Cam and


Open CV
Dr. Arulmurugan L
Associative professor
Department of Electronics Engineering
Bannari Amman Institute of Technology
Sathy, Tamil Nadu

Pradeep S Nikhil Raghav V Bharath Kumar S P


Department of Electronics Engineering Department of Electronics Engineering Department of Electronics Engineering
Bannari Amman Institute of Technology Bannari Amman Institute of Technology Bannari Amman Institute of Technology
Sathy, Tamil Nadu Sathy, Tamil Nadu Sathy, Tamil Nadu

Abstract – In forest and agricultural field human and extreme cases they lose their life, so the field or zone is
animal conflict is a major problem where enormous continuously monitored to prevent entry of animals are any
amount if resources are lost and human and animal life other unwanted intrusion. The animal intrusion detection
are endangered. Due to this animal lives are endangered. system uses a camera and a remote server to detect animals.
People lose their crops, cattle and in some extreme cases ESP32 is a cost-efficient camera module used to stream
they lose their lives. In current era of continuously live footage to the server via wifi. Arduino IDE is used to
developing IOT sensors and cloud technology, Image upload the firmware to the module. The firmware contains
processing in remote areas became easy and cheap. To the configuration details like picture quality. Object
tackle this problem, we have developed a system with detection algorithm based on yolov5 is used for object
cameras and remote cloud server to capture live footage detection. The algorithm is pre-trained with thousands of
of area to be protected and processing the footage in a annotated images multiple times to achieve maximum
live server to detect animal intrusion. For hardware accuracy. The camera module is placed in multiple places in
components, we have used ESP32 camera module with the field to achieve maximum coverage. The captured live
Wifi to capture live footages. The captured footage is footage is sent to a cloud server using wifi and it is
sent to a remote server or PC for further processing. A processed using pre-trained algorithm. The objects in the
yolov5 based pre-trained algorithm is used for object video are detected and classified based on their similarities.
detection. To achieve maximum accuracy the algorithm Based on the animal detected on the footage an alert is sent
is trained with thousands of animal photos multiple to the farmer.
times until desired accuracy is reached (~98%). The
footage is processed and based on the type of animal II. RELATED WORKS
detected a message or alert is sent to the farmer or forest
department from the server and a speaker can be used to Priya Sharma et al., [1] introduced a system designed
scare the animals. to safeguard crops from potential threats posed by animals.
Their innovative solution relies on a combination of a
Keywords:- Animal Detection, ESP32 CAM, Yolov5. Raspberry Pi and a PIR sensor. The PIR sensor serves to
detect any motion made by animals, prompting the camera
I. INTRODUCTION to activate and capture images. These captured images are
subsequently transmitted to the Raspberry Pi for analysis
India is a global agricultural powerhouse. It is the and classification of the detected animal. Based on this
world’s largest producer of milk, pulses, and spices, and has classification, the system takes appropriate actions to protect
the world’s largest cattle herd, as well as the largest area the crops.
under wheat, rice and cotton. Most of these lands are located
in rural and forest area. Animal intrusion is unavoidable in Prajna. P et. al. [2] have developed a field monitoring
these areas. As humans started to change forests into fields system. This system begins by utilizing a sensor to identify
and residential area wild animals are forced to enter into any encroachments around the field, followed by activating
these areas for food and water. Elephants or wild boar tramp a camera to capture an image of the intruder. Subsequently,
the vegetation in farm land in need of nutritious food. it employs image processing techniques to categorize the
Human-Elephant is more frequent in south Asia and in intruder, and based on this classification, it takes suitable
Africa. This leads to conflict between humans and animals measures to address the intrusion. Finally, the system sends
and in some cases endangerment of animal species. In recent a notification to the farm owner to keep them informed.
times the number of these kinds of these kinds of conflicts
are increasing. People lose their crops and cattle and in some

IJISRT23OCT840 www.ijisrt.com 913


Volume 8, Issue 10, October – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
Sk. Almas Tabassum et. al. [3] introduced a system generated in this study can be effectively employed within
designed to protect crops from potential threats posed by TensorFlow for object detection.
animals such as cows, buffaloes, and elephants. These
animals occasionally enter crop fields and can cause [7] In her research paper, Anita Chaudhari proposed an
significant damage by trampling and consuming the crops. object detection system that employs CNN (Convolutional
The system is designed to identify these animals and Neural Network) technology. This system is designed to take
promptly send a photograph of the detected animal to the images of various fruits and vegetables, categorizing them
farmer. Furthermore, it emits a continuous buzzing sound as into distinct classes and providing nutritional information.
long as the animal remains within the camera's view, alerting When you capture an image of your plate of food, the
the farmer to the presence of the intruder. application uses these images to perform comparisons.
Subsequently, it generates a list of items that are most likely
Howard et. al n their paper [4], the authors introduce a to be present in your meal. Instead of presenting a single
category of efficient models known as Mobile-Nets, tailored choice with all the items on your plate combined, it lists
for applications in mobile and embedded vision. Mobile- each recognized item individually. For instance, if there are
Nets are constructed using a streamlined architecture that oranges on your plate, the object class detection component
leverages depth wise separable convolutions, resulting in of the system identifies and reports various features of the
lightweight deep neural networks. The authors also oranges, such as their shape, colour, texture, and so on. This
introduce two straightforward global hyperparameters that enables a more detailed and accurate assessment of the
effectively balance the trade-off between computational objects present in the image.
speed and model accuracy. These hyperparameters empower
model developers to select an appropriately sized model that III. PROPOSED WORK
aligns with the specific constraints of their application. The
paper includes an extensive set of experiments evaluating In this project ESP32 cam module is used. With the
the trade-offs between resource usage and model accuracy. ESP32-S chip, the ESP32-CAM is a tiny camera module
The results demonstrate Mobile-Nets' robust performance with wifi module. A microSD card slot is included in
when compared to other widely-used models in the context addition to the OV2640 camera and several GPIOs for
of ImageNet classification. Additionally, the authors connecting peripherals. This slot can be used to store images
illustrate Mobile-Nets' effectiveness in various applications captured by the camera or files that will be provided to
and use cases, spanning object detection, fine-grained clients. The ESP32-CAM doesn’t come with a USB
classification, face attribute analysis, and large-scale geo- connector, so you need an FTDI programmer to upload
localization. code through the U0R and U0T pins (serial pins).

[5] Yiting Li presented this research paper with the aim


of achieving real-time and highly accurate detection of
surface defects using deep learning techniques. To
accomplish this goal, the study adopted a Single Shot Multi-
Box Detector (SSD) architecture, which was integrated into
the MobileNet architecture at the bottom convolutional
neural network (CNN) level, resulting in what is referred to
as MobileNet SSD. To collect target images for the detection
process, the system utilizes a combination of parallel
cameras, digital cameras, and charge-coupled devices (CCD
cameras). These cameras are employed to capture images of
the objects of interest, extract relevant features, and establish
mathematical models for analysis. MobileNet SSD primarily
relies on paired cameras, digital cameras, depth cameras,
Fig 1: ESP32 Cam
and CCD cameras to achieve its objectives.

[6] In his research paper, Debojit Biswasa proposed the


implementation of SSD (Single Shot Detection). The most
labour-intensive task for any object detection algorithm is
the creation of training datasets. In this work, approximately
500 objects were labelled across 450 images. Each labelled
image generated an .xml file containing detailed
information, including the location, height, and width of the
labelled objects. Before presenting the labelled dataset to
SSD, a mapping was created to establish the dataset's
context. SSD was implemented using TensorFlow, serving
as the base model for Mobile-Net-SSD. The Mobile-Net
architecture was stored as Mobile-Net and was used for Fig 2: ESP32 pinout
cross-training with TensorFlow SSD. The processes

IJISRT23OCT840 www.ijisrt.com 914


Volume 8, Issue 10, October – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
FTDI USB to TTL serial converter modules are used
for general serial applications. They are popularly used for
communication to and from microcontroller development
boards such as ESP-01s and Arduino micros, which do not
have USB interfaces. It is used to program ESP32 module
and upload firmware.

Arduino IDE is used to program ESP32 module.


ESP32 cam library is imported for video streaming. The
esp32cam library provides an object-oriented API to
use OV2640 camera on ESP32 microcontroller. It is a
wrapper of esp32-camera library. It is programmed to
connect to a local wifi and send the video to a remote pc.

Fig 4: Overview of YOLOv5

In order to get your object detector off the ground, you


need to first collect training images. You want to think
carefully about the task you are trying to achieve and think
ahead of time about the aspects of the task your model may
find difficult. I recommend narrowing the domain that your
model must handle as much as possible to improve your
final model’s accuracy.

Fig .3: Circuit connections

Once the ESP32 cam is configured the live footage is


sent to a remote server or PC. On the server yolov5 is used
for object detection. A custom, annotated image dataset is
vital for training the YOLOv5 object detector. It allows us to
train the model on specific objects of interest, leading to a
detector tailored to our requirements. Annotated animal
image dataset is used for the model training.

YOLOv5 is a recent release of the YOLO family of


models. YOLO was initially introduced as the first object
detection model that combined bounding box prediction and Fig 5: Object detection block diagram
object classification into a single end to end differentiable
network. It was written and is maintained in a framework The model is trained with thousands of annotated
called darknet. YOLOv5 is the first of the YOLO models to animal images for multiple epochs until desired accuracy is
be written in the PyTorch framework and it is much more reached. The accuracy of the model is calculated by dividing
light weight and easy to use. That said, YOLOv5 did not the image dataset into training and evaluation set. 80
make major architectural changes to the network in percentage of images are used for training and the remaining
YOLOv4 and does not outperform YOLOv4 on a common 20% is used for evaluation. When animal is detected the
benchmark, the COCO dataset. Yolov5 seek to identify the class of the animal is identified. If the particular animal is
presence of relevant objects in images and classify those dangerous a message is sent to the person using python
objects into relevant classes. We need to train the yolov5 to messages library.
recognize each one of those objects and classify them
correctly. This model will separate the bounding box The final python script is uploaded to a cloud server or
regression from object classifications in different areas of a executed in a remote PC for live animal detection. It is
connected network. cheaper than surrounding the property with electrical fence
and other protection methods. It can be implemented in
forests to find and track endangered species and animal
pouching can also be prevented.

IJISRT23OCT840 www.ijisrt.com 915


Volume 8, Issue 10, October – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
IV. RESULT AND DISCUSSION the system's reliability and efficacy. In the bigger picture, the
utilization of the ESP32-CAM module for animal intrusion
Employing the ESP32-CAM in tandem with OpenCV detection represents a promising strategy for mitigating the
for animal intrusion detection represents an inventive and repercussions of animal intrusions on various facets of
practical strategy for safeguarding areas susceptible to human existence and the natural world. By harnessing this
wildlife or animal presence. The integration of the ESP32- technology, we can enhance the safeguarding of invaluable
CAM's versatile capabilities, encompassing built-in Wi-Fi assets, reinforce safety measures, and make meaningful
and camera functionality, with the robust computer vision contributions to the preservation of wildlife and ecosystems.
library, OpenCV, empowers the development of an advanced
real-time system for identifying and alerting to the presence REFERENCES
of animals. This technology holds significant potential
across various domains, including wildlife conservation, [1]. Priya Sharma, Sirisha C K, Soumya Gururaj, and
agricultural security, and residential protection, providing an Padmavathi C, “Neural Network Based Image
effective and automated means of detecting and responding Classification for Animal Intrusion Detection System”,
to animal intrusions. This project will explore the hardware IJPRSE, vol. 1, no. 4, pp. 1–7, Jul. 2020.
setup, software implementation, and potential application [2]. Prajna. P, Soujanya B.S, Mrs. Divya, “IoT-based Wild
scenarios of this solution for animal intrusion detection. Animal Intrusion Detection System”, International
Journal of Engineering Research & Technology
(IJERT) ICRTT – 2018 (Volume 06 – Issue 15).
[3]. Sk. Almas Tabassum, B. Sri Vaishnavi, Dr K. S. Sagar
Reddy, “SMART CROP PROTECTION WITH
IMAGE CAPTURE OVER IOT”, International Journal
of Research in Engineering, IT and Social Science,
ISSN 2250-0588, Impact Factor: 6.565, Volume 09,
Special Issue 2, May 2019.
[4]. Howard, Andrew & Zhu, Menglong & Chen, Bo &
Kalenichenko, Dmitry & Wang, Weijun & Weyand,
Tobias & Andreetto, Marco & Adam, Hartwig. (2017).
"MobileNets: Efficient Convolutional Neural Networks
for Mobile Vision Applications."
[5]. A. Yiting Li, Haisong Huang, Qingsheng Xie and
Liguo Yao, “Research on a Surface Defect Detection
Fig 6: Result Algorithm supported Mobile-Net SSD” IEEE
Transactions on Pattern Analysis, vol. 34, pp. 743–761,
Sep 2018.
[6]. B. Debojit Biswasa, Hongbo Sua, Chengyi Wangb,
Aleksandar Stevanovica, Weimin Wangc, “An
automatic traffic density estimation using Single Shot
Detection (SSD) and MobileNet-SSD”, pp. 3354–
3361, Dec. 2018.
[7]. C. Anita Chaudhari, Shraddha More, Sushil Khane,
Hemali Mane, Pravin, “Object Detection using
Fig 7: Alert Convolutional Neural Network within the Application
of Supplementary Nutrition Value of Fruits,”
V. CONCLUSION International Journal of Innovative Technology and
Explore Engineering, vol. 8, pp. 2278-3075, Sep. 2019.
In summary, the application of the ESP32-CAM
module for animal intrusion detection stands as a versatile
and valuable solution across diverse sectors and industries.
It holds the promise of bolstering wildlife preservation
initiatives, safeguarding agricultural assets such as crops and
livestock, fortifying property security, averting infrastructure
damage, and facilitating essential environmental research.

While the ESP32-CAM module offers numerous


advantages, such as cost-effectiveness and scalability, it is
essential to recognize and address its inherent limitations.
These limitations encompass factors such as detection range
limitations, sensitivity to varying weather and lighting
conditions, and the potential for false positives. Diligent
planning, customization, and optimization strategies are
imperative to counterbalance these constraints and ensure

IJISRT23OCT840 www.ijisrt.com 916

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy