CROP PROTECTION FROM ANIMALS USING CNN - IRJMETS

e-ISSN: 2582-5208

International Research Journal of Modernization in Engineering Technology and Science

( Peer-Reviewed, Open Access, Fully Refereed International Journal )

Volume:04/Issue:03/March-2022

Impact Factor- 6.752



CROP PROTECTION FROM ANIMALS USING CNN

T. Sandeep*1, B. Manushree*2, S. Rahul*3, T. Bharath*4

*1Assistant Professor, ECE Department, SNIST, Hyderabad, India. *2,3,4UG Scholar, ECE Department, SNIST, Hyderabad, India.

ABSTRACT

Surveillance is used extensively in a variety of settings, including homes, hospitals, schools, public spaces, and farmlands. Surveillance is critical in the case of farmlands or agricultural fields to prevent illegal people from entering the area and to safeguard the region from animals. Various approaches focus solely on surveillance, mostly for human invaders, but we often overlook the fact that the biggest enemies of such farmers are the animals that damage their crops. This results in low crop yields and considerable financial losses for agricultural owners. This problem is so severe that farmers have been known to leave areas barren owing to frequent animal attacks. This system helps us to drive away wild animals from the farmlands as well as provides surveillance functionality. Crop depredation by wild boar had alarmingly increased in recent years due to their abruptly increased population. Agricultural pests like birds and rats can devastate crops and limit growers' capacity to supply agricultural goods to the market. As a result of reduced production of fuel commodities for processing and sale, the larger economy may suffer. Because the agricultural sector often provides inputs to practically all other sectors of the economy, the multiplier effects of this type of damage may be negative if it plays a significant role in the economy. It's an investigation on the tactics used to control birds and rodent pests. Edge computing has emerged as a critical technology for real-time application development in recent years, since it brings processing and storage capabilities closer to end devices, lowering latency, improving response time, and ensuring secure data flow. In this paper, we focus on a Smart Agriculture application that uses computer vision and ultrasound emission to create virtual fences to protect crops from ungulate attacks, resulting in considerable reductions in production losses. This is an innovative technique that can generate ultrasound to drive away ungulates and thus protect crops from attack, this paper details the design, development, and testing of an intelligent animal repulsion system that can detect and recognise ungulates as well as generate ultrasonic signals tailored to each ungulate species. The proposed system is based on image processing platforms that offer a good balance of performance, cost, and energy consumption while also taking into account the constraints imposed by the rural environment in terms of energy supply and network connectivity. Experiments show that by deploying animal detectors on power-efficient edge computing devices, the intelligent animal repelling system can be implemented without sacrificing mean average precision or meeting real-time requirements. The experimental study also includes a cost and performance analysis for each HW/SW platform, as well as average and peak CPU temperature readings. This article also highlights best practises, as well as how the integrated technology can aid farmers and agronomists in their decision-making and management processes. Computer neural networking, deep learning.

Keywords: Keras, Tensorflow, Jupyter Notebook, Testing, Training, Ultrasonic Repellants.

I. INTRODUCTION

Agriculture has always been the most important economic sector in India. Despite the fact that agriculture employs the majority of India's population, farmers face numerous challenges. Deforestation happens as a result of overpopulation, depriving forest regions of water, food, and shelter. As a result, animal incursion into residential areas is increasing day by day, posing a threat to human life and property, as well as causing conflict between humans and animals. Agriculture is the backbone of the economy, but animal intrusion in agricultural land would result in massive crop loss. Elephants and other animals interacting with humans have a negative influence in a variety of ways, including crop devastation, damage to food stockpiles, water supplies, homes and properties, injuries, and human mortality. Conflict between human beings may also be a serious problem where large quantities of money are wasted and life is at risk. In recent times the numbers of those types of conflicts are increasing. Farmers in India has been facing serious threats from natural calamities, pests and damage by animals leading to lower yields. Ancient strategies are being followed by farmers aren't much effective and it's not being feasible to hire guards to keep an eye fixed on the crops and forestall the wild animals. Therefore this



@International Research Journal of Modernization in Engineering, Technology and Science [583]

e-ISSN: 2582-5208

International Research Journal of Modernization in Engineering Technology and Science

( Peer-Reviewed, Open Access, Fully Refereed International Journal )

Volume:04/Issue:03/March-2022

Impact Factor- 6.752



zone is to be monitored continuously to prevent entry of this kind of animals or the other unwanted intrusion. So, animal detection system is being vital in farm areas. Crops are mainly damaged by local animals like buffaloes, cows, pigs, goats, birds, and fire, etc. This leads to huge losses for the farmers. Agriculture farming is the main source of livelihood for many people in different parts of the world. Regrettably, farmers continue to rely on centuries-old ways. Crop yields are decreasing as a result of this. Furthermore, a number of factors lead to reduced agricultural yields, one of which being animal encroachment. In recent years, farmers all across the world have faced a unique challenge: wild animals. Wild creatures such as wild boars, elephants, deer, tigers, and monkeys, among others, trample crops by running across them. As a result, farmers are facing financial challenges. Farmers must physically irrigate a large quantity of agricultural land, which takes a long time.

II. PROBLEM STATEMENT

Animal attacks are a typical occurrence in India these days. These attacks kill villages and destroy their crops due to the lack of any detection system. These folks are helpless in the face of their fate due to a lack of sufficient safety precautions. As a result, a proper detection system could assist save their lives as well as the crops. Villagers' crops are also ruined as a result of animal meddling. The rapid loss of forests and encroaching crop area has resulted in an increase in animal invasion of fields, causing a significant shift in farmers' attitudes toward them. Harmony between a farmer and wild animals appears to be the next best thing to a miracle.

III. EXISTING METHODOLOGY

Animals are shocked by electric fences, and there is a risk of fire if plants or shrubs grow too close to the fence. If the fence is not adequately maintained, electromagnetic interference occurs, interfering with telephone and radio signals. Despite being the most often utilised farm protection measure, electric fencing is harmful to both animals and humans. Thorn fencing, which is also a widely used tactic, provides a similar effect to the prior technique.

IV. PROPOSED METHODOLOGY

The proposed prototype uses a software that recognizes animals and classifies them accordingly.The software required can be developed using openCV and deep learning algorithms. This can be embedded with a ultrasonic repellant hardware system that drives the animal away from the farm and also intimates the farmer about this. This is a low cost project that aims at driving the animals away without causing any lethal harm or death to them, as well as not destroying the natural resources in the deployed environment.

V. DOMAIN DESCRIPTION

Image processing is a technique to change over a picture into computerized frame and play out certain procedure on it, so as to recover an upgraded picture or to separate some helpful information from it. Normally the information is a picture, similar to video casing or photo and yield might be picture or qualities related with that picture. Typically Image Processing framework incorporates regarding pictures as two dimensional signs while applying effectively set sign preparing techniques to them.

Image processing is separated into five categories. They are as follows:

Visualization - Pay attention to the things that aren't apparent.

To make a better image, image sharpening and restoration are used.

Image retrieval - Look for the image you're looking for.

Pattern measurement - calculates the size of distinct items in a picture.

Distinguish the objects in an image using image recognition.

VI. SOFTWARE REQUIREMENTS

Jupyter Notebook:

The Jupyter Notebook App is a web-based server-client tool for editing and executing notebook papers. The Jupyter Notebook App may be run locally on a computer without the need for an internet connection, or it can be installed on a remote server and accessible through the internet. The Jupyter Notebook App contains a Dashboard (Notebook Dashboard), a control panel that shows local files and allows you to open notebook papers or shut down their kernels, in addition to displaying/editing/running notebook documents. The code



@International Research Journal of Modernization in Engineering, Technology and Science [584]

e-ISSN: 2582-5208

International Research Journal of Modernization in Engineering Technology and Science

( Peer-Reviewed, Open Access, Fully Refereed International Journal )

Volume:04/Issue:03/March-2022

Impact Factor- 6.752



included in a Notebook document is executed by a notebook kernel, which is a computational engine. Python code is executed via the ipython kernel, which is mentioned in this tutorial. There are kernels for a variety of different languages (official kernels). The accompanying kernel is automatically launched when you open a Notebook document. The kernel executes the computation and delivers the results when the notebook is run (either cell by cell or using the menu Cell -> Run All). The kernel may require a substantial amount of CPU and RAM depending on the type of computations. It's worth noting that the RAM isn't released until the kernel is turned off.

Keras:

Keras is a Python based platform that implements deep learning algorithms and API that runs on top of TensorFlow, a machine learning platform. It was created with the goal of allowing for quick experimentation. It's crucial to be able to get from idea to outcome as quickly as feasible when conducting research. Keras provides industry-strength performance and scalability: it is used by organizations and companies including NASA, YouTube, or Waymo.It is a Python-based application programming interface (API) for high-level neural networks. This open-source neural network toolkit is built on top of CNTK, TensorFlow, and Theano and can be used to quickly experiment with deep neural networks. Keras emphasises modularity, usability, and extensibility. It doesn't handle low-level computations; instead, it passes them on to the Backend, a separate library. In mid-2017, Keras was adopted and incorporated into TensorFlow. The tf.keras module gives users access to it. The Keras library, on the other hand, may continue to function independently.

Tensorflow:

TensorFlow is an open-source machine learning platform that runs from start to finish. It may be thought of as a foundation layer for differentiable programming. It is a symbolic math toolkit for neural networks that is ideally suited for dataflow programming in a variety of applications. It allows you to construct and train models at many abstraction levels. TensorFlow is a promising and rapidly developing deep learning platform that provides a flexible, complete ecosystem of community resources, libraries, and tools for creating and deploying machine learning programmes.

Deep Learning:

Deep learning mimics the neural pathways of the human brain in data processing, allowing it to be used for decision-making, object detection, speech recognition, and language translation. It learns without the need for human involvement or supervision, using unstructured and unlabeled data. Deep learning uses a hierarchical level of artificial neural networks, structured like the human brain, with neuron nodes linking in a web, to process machine learning. Traditional machine learning algorithms analyse data in a linear fashion, whereas deep learning's hierarchical function allows computers to interpret data in a nonlinear manner.

VII. FLOW CHART



@International Research Journal of Modernization in Engineering, Technology and Science [585]

e-ISSN: 2582-5208

International Research Journal of Modernization in Engineering Technology and Science

( Peer-Reviewed, Open Access, Fully Refereed International Journal )

Volume:04/Issue:03/March-2022

Impact Factor- 6.752



Whenever an intrusion is detected, the model which has been trained by using keras and tensorflow to identify animals is triggered to check and identify the animal intrusion. If the animal is identified as an animal among the trained classes, an ultrasonic repellant can be turned on to drive the animal away and an alert message is sent.

VIII. SOURCE CODE

from keras.models import Sequential

from keras.layers import Dense from keras.layers import Convolution2D from keras.layers import MaxPooling2D from keras.layers import Flatten

from keras.preprocessing.image import ImageDataGenerator

train_datagen=ImageDataGenerator(rescale=1./255,shear_range=0.2,zoom_range=0.2,horizontal_flip=True)

test_datagen=ImageDataGenerator(rescale=1./255)

x_train=train_datagen.flow_from_directory(r"C:\Users\Manushree\Desktop\NewDataset\TrainSet",target_size =(64,64),batch_size=32)

x_test=train_datagen.flow_from_directory(r"C:\Users\Manushree\Desktop\NewDataset\TestSet",target_size=( 64,64),batch_size=32)

x_train.class_indices

model=Sequential()

model.add(Convolution2D(32,(3,3),input_shape=(64,64,3),activation="relu"))

model.add(MaxPooling2D(pool_size=(2,2)))

model.add(Flatten())

model.add(Dense(units=128,init="uniform",activation="relu"))

model.add(Dense(units=5,init="uniform",activation="softmax"))

pile(loss="categorical_crossentropy",optimizer="adam",metrics=["accuracy"])

model.fit_generator(x_train,steps_per_epoch=147,validation_data=x_test,validation_steps=70,epochs=20)

from keras.models import load_model

from keras.preprocessing import image

img = image.load_img(r"C:\Users\Manushree\Desktop\chk imgs\.jpg",target_size = (64,64))

import numpy as np

x = image.img_to_array(img)

x = np.expand_dims(x,axis = 0)

x.shape

ypred=model.predict_classes(x)

index=['Bear','Bison','Deer','Elephant','Zebra']

print(index[ypred[0]])

import cv2

p = cv2.imread(r"C:\Users\Manushree\Desktop\chk imgs\d4.jpg")

cv2.imshow("image",p)

cv2.waitKey(0)

cv2.destroyAllWindows()

model.save("model.h5")

IX. RESULTS AND DISCUSSION

Download the testset and trainset images from existing libraries which are available as Github repositories with each class consisting of 5000 images.



@International Research Journal of Modernization in Engineering, Technology and Science [586]

e-ISSN: 2582-5208

International Research Journal of Modernization in Engineering Technology and Science

( Peer-Reviewed, Open Access, Fully Refereed International Journal )

Volume:04/Issue:03/March-2022

Impact Factor- 6.752



Class A: Bear

Class B: Elephant

Class C: Leopard

Class D: Lion

Class E: Wolf



@International Research Journal of Modernization in Engineering, Technology and Science [587]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download