Wildlife Detection System using Deep Neural Networks

Page 1

International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056

Volume: 09 Issue: 07 | July 2022 www.irjet.net p ISSN: 2395 0072

Wildlife Detection System using Deep Neural Networks

M N

1 , Pragati Agrawal2 , Mrs. Mona3

1VIII Semester, Dept. of ISE, BNMIT, Bangalore, India, rithvikmn@gmail.com

2VIII Semester, Dept. of ISE, BNMIT, Bangalore, India, pragatiagrawal012@gmail.com

3Assistant Professor, Dept. of IS Engineering, BNMIT, Karnataka, India ***

Abstract Animals moving out of the forest region and moving into the human environment is growing day by day. Animals entering the farming regions put close to the forest ruin crops or even assault on people therefore there is a need of system which detects the animal existence and gives caution about that in the position of security objective. The proposed project “Wildlife Detection using Deep Neural Networks” provides the users with type of animal and count to make the process of animal vehicle collision easy. The detection of the animal is done using CNN by converting images into greyscale, segmented and masked in the pre processing stage. Then using Computer Vision technique, bounding boxes are formed around animals and count is also printed with the use of CV library. The whole project can tell which animal and count of those animals present. The proposed system uses the algorithms namely AlexNet, ResNet, Maxpooling 2D.

Key Words: ComputerVision,MachineLearning, Twilio, CNN

1. INTRODUCTION

Observingwildanimalsintheir natural environmentsisa centraltaskinecology.Anincreasingareaoflandsurfacehas been transformed by human action, altering wildlife population, habitat, and behaviour. Since there are many differentanimals,manuallyidentifyingthemisa daunting task.So,analgorithmthatcanclassifyanimalsbasedontheir imagescanhelpresearchersmonitorthemmoreefficiently. Wildlifedetectionandclassificationcanhelppreventanimal vehicle accidents, trace animal facility, prevent theft, and ensurethesecurityofanimalsinzoo.Theapplicationofdeep learningisrapidlygrowinginthefieldofcomputervision and is helping in building powerful classification and identificationmodels.WildlifeDetectionSystemwillhelpto preventorreducethenumberofanimal vehiclecollisions.It facilitates individuals to have a well knowledge of living animals on earth by monitoring animal activities, particularlyhowtheanimalcooperateswithitsecosystem. Theanimalidentificationisusedtoclassifytheanimalthat has been identified. Administration of animal treatment develops an essential problem as animals immediately impacttheinnerandphysicalhealthofhumans.

1.1 Objective

Theaimoftheprojectis:

1. Tobuildawildlifedetectorthatcanapproximately identifyandclassifytheanimalbreedandclass.

2. Themodelwillalsogivecountofanimalspresentin frontofcamera.

2. LITERATURE SURVEY

Yu,X.,Wang,J.,Kays,R.et.al[1]haveproposedasystemin whichthealgorithmusedisScSPM.Thedatasetconsistedof 7196 images with 18 different vertebrate species. The imagesusedwereofwildlifedepictedwithmotion sensitive cameratraps,whichgeneratedseriesof3.1MegapixelJPEG images at about 1 frame/s upon activating by an infrared motionsensor.Theimageswereallconvertedintogreyscale and both the SIFT descriptor were then extracted from 16x16pixelpatches.Allpatchesofeachimageweredeeply sampledonagridwithstepsizeof4pixels.Intheproposed model,bothSIFTandcLBPwerenormalizedtobeunitnorm withdimensions128and59,respectively.Forthedictionary learningprocess,thesystemextractedSIFTandcLBPfrom 20,000patchesthatwererandomlysampledontrainingset. DictionariesweretrainedforSIFTandcLBPseparately,with thesamedictionarysize K =1,024.Theoverallperformance achievedbythesystemwasabout82%.Foronethirdofthe 18species,thissystemobtainedclassificationaccuracyover 90%.

Willi,M., Pitman,R. T.,Cardoso,A. W.,Locke,C., Swanson. et.al [2] have provided a step by step approach in recognizing four camera trap datasets which were accumulated by various research squads Every dataset comprised of camera trap images and their observations providedbycitizenscientistsonZooniverse.Theproposed method used capture event interpreted by various citizen scientists applying the Zooniverse platform. The method shows that research players for each design aligned how many observations per capture event that was necessary earlier it was believed finished (retired) evaluating classificationvalueandtimetoprocedurethewholedataset. Itwasseenthattheretirementlimitswerecoursespecific and frequently dynamically adjusted based on volunteer consensus.Theresearchers builtproject limitedworkflows bychoosingseveralchoices forprojectstobedonebythe citizenscientists.

©
Journal | Page729
2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified

International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056

Volume: 09 Issue: 07 | July 2022 www.irjet.net p ISSN: 2395 0072

Parikh,M.,Patel,M.,&Bhatt,D.et.al[3]describes wherethedatasetconsistedofonefolderconsistingoftarget imagesandotherthetemplateimages.Heretheproposed systemhasusedmixtureofframedifferencingmethodfor backgroundsubtraction.Toperformtemplatematchingin MATLAB, the system has used the concept of normalized crossco relation.Themethodusedinthissystemsearchesa long duration signal for a shorter, known feature. The proposedsystemgaveafalsepositiverateforthecodewas 13.3 %. Thus, the efficiency of the code comes out to be 86.7%.ThesystemlacksefficiencysoinfutureSVM,Neural networkswasused.

Shetty,Singh,Shaikhetal.[4]describesthatTenfold crossvalidationcanbeusedtoclassifyanimalimages.The systemconsistedofcamera trapdatafordemonstrationand assessedtheaccuracy.Thedatasetcontained20varietiesof animals with 100 image sequence for each species. The method divided the full feature dataset into ten identical folds. From ten folds, nine were contemplated as training data and enduring one was used as test. The system then repeatedtheprocesstentimessothateachimagewasused astestimage.Theendresultwastheaverageofallresults. Thewildlifedetectionshowedperformanceaccuracyof91% withF1 measureupto0.95.

Schindler,F.,&Steinhage,V.et.al[5]showsthatthe dataset material implemented was supplied from the Bavarian Highway Directorate, Germany. It showed video slides,eachonearound10swith8fps(framespersecond) andaresolutionof1280×720pixel.Thissystemusedtwo approachesnamelyMaskR CNNandFlow GuidedFeature Aggregation.MaskR CNNwasthemethodofselectiondueto its enhanced recognition performance in images Flow GuidedFeatureAggregationofferedtheoccasiontoenhance object detection in video clips by incorporating temporal informationinconditionsoftheopticalflowintheirinternal featurecomputation.Thissystemyieldedthefinestresults withanmedianprecisionof 63.8%foranimal recognition and identification. Mask R CNN achieved an average accuracyof39.8%ontheofficialCOCOchallengedataset.For activityrecognitionthecorrectnessrangedbetween88.4% and94.1%.

H.Nguyen et al.[6]describesthedatasetusedinthis system consisted of training class that had equivalently 25,000samplesfortrainingand8500forvalidation.Model basedimageclassificationalgorithmwasimplementedhere. Theoverallaccuracywascloseto96%.Implementationand application of deeper CNN models for improving system performanceandenhancingthedatasetwasimplemented.

Sanjay,S.,Balamurugan,S.Set.al[7]describesthe datasetusedinthissystemwhichwasestablishedonGoogle OpenimagesandCOCOdatasetswhichcomprisedofaround 20,000images.TheconceptofMachineLearningandDeep Learning algorithms were used and implemented in this system. Segregation of animals with a huge open source

datasetwasused.Theaccuracygainedbythissystemwas 91% under the various lighting and positions. The model usedinthissystemwasevaluatedwith200randomimages from internet from which around 180 forecasts were perfectlyaccurate

Verma, Gyanendra & Gupta, Pragya et al, [8] explainsthedatasetusedwhichconsistedofthetraditional camera trap dataset for testing and to assess the system routine.Thedatasetcontains20typesofanimalswith100 seriesofimages.The machinelearningalgorithmslikethe SupportVectorMachine,(SVM),K NearestNeighbor(KNN) algorithms was used in this system. The system gave a performance accuracy of 91.4% with the use of KNN and DCNNfeatures.

3.METHODOLOGY

The proposedsystemisa wildlifedetection system which detect animals using deep learning model. The proposed system presents a system where first the datasets are definedandthenintroduceaCNNmodelwhichwillhelpin classifyingtheseimagesintowildlifeanimals.

Initially,preprocessingisthefirststageoftheprojectwhere images are transformed to 3D and 4D tensor for spatial fillings.Forpreprocessing,librarieslikeKerasandPILare imported. Keras is an open resource software library that offersaPythoninterfaceforartificialneuralnetworks.Keras cansupportmultipleback endslikeTensorFlow,Theanoand PlaidML.Convert2 dimensionalimagesto3Dtensorisdone byaddingdepthtotheimage.4Dtensorimagecanbemade byputtingallthese3Dtensorstoanarray.

AlexNetalsoplaysamajorroleindeeplearningforimage classification.ItisaCNNarchitecturewhichhas8layersof Neural Networks. AlexNet architectures has sequential layers of neural networks as well as Maxpooling with activation function ReLu. It also has two fully connected layers which consists of ReLu non activated layer and DropOut layer to reduce overfitting. The softmax layer is usedhereformulticlassificationofimages.Alllayershavea sizeof3x3filtersforcalculationsofweights.

Thefollowingfigureshowshowtheflowofsystemworks:

1.Theuserwillinputtheimageofanimalthecameratrap wouldhavecaptured.

2.ImageprocessingwilltakeplaceusingKeraslibraryof DeepLearning.

3.FeatureswillgetextractedusingTensorFlowasbackend.

4.Based on feature extraction a machine learning model willgetgeneratedandtrained.

©
| Page730
2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal

International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056

Volume: 09 Issue: 07 | July 2022 www.irjet.net p ISSN: 2395 0072

5.Thenthetestimageshavetobeprovidedtocomparethe trainandtestdata

6.Animalswillgetclassifiedanddetectedbasedontrained model.

featureswere fedintolayersfor wildlifedetection.Inthis study,theselayerswereutilizedtodetectanimalSequential, MaxPooling,ConvolutionalandDropout.

Thesystemworksasbelow:

1. Thedatasetinthefilesystemisuploadedintothe system.

2. Theuploadedimageissentforpreprocessing.This step involves: Reading and capturing of image, convertingimageto3Dtensorand4Dtensor.

3. The image is further processed to detect if any animalispresentinthem.

4. The detected animals in the previous step are classified into their type like bear/elephants/empty/etc.

Fig 1 Flow Diagram of Methodology

3.1 System Architecture

Thearchitecturalconfigurationprocedureisinvolvedwith constructingupa basicsystemforaframework.Itinvolves identifyingtherealpartsoftheframeworkand exchanges between these segments. The starting configuration procedureofrecognizingthesesubsystemsandbuildingupa compositionforsubsystem control andcorrespondence is calledconstructionmodellingoutlineandthereturnofthis outlinedprocedureisadepictionoftheproductstructural planning

3.2

5. Thecountofanimalsisthenprintedtotheuser.

6. Theresultisprintedandsentasamessage.

System Data Flow

DFD or Data Flow Diagram signifies the flow of data of a methodoraprocess.Itprovidesinsightintotheinputsand outputsofeachobjectandthewayitself.DFDdoesnothave acontrolflowandnoloopsorjudgmentrulesaretriggered Specific operations varying on the type of data can be described by a flowchart. The DFD belongs to structured analysismodellingtools.DataFlowdiagramsareextremely widespread because they help us to imagine the main activitiesanddataengagedinsoftware systemsprocedures

Fig-3 System Data Flow

The image dataset is loaded into the wildlife detectionsystem.

Fig-2 System Architecture

Aseriesofexperimentswereconductedusingdeeplearning models which include AlexNet, ResNet, etc.. to evaluate animaldataset.Figureshowsthegeneralstructureofanimal diagnosisinthispaper.Inpre processing,themeanmethod wasusedtoconvertimagesinto3Dand 4Dspatialfeatures. The features of importance associated with the types of significancerelatedwiththetypesofimportanceforwildlife detectionwerechosenusingtheCNNmodel.Thesechosen

Thesystemdetectstheloadeddatasetintothetypes ofanimalsandthisresultisprintedintheconsole.

4. IMPLEMENTATION

TheproposedSystemusesthedifferentmoduleswhichthe systemusesandcomesacross:

DataCollection

DataPreprocessing

2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal

Page731
©
|

International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056

Volume: 09 Issue: 07 | July 2022 www.irjet.net p ISSN: 2395 0072

BuildingTrainingmodel

Predictionofanimals 

Detectingcountofanimals

SendingmessagewithnumberusingAPIs.

Theanimaldatasetwascollectedfromvariouscamera trapimages.Thedatasetcomprises610imagesdividedinto 410 training images and 200 testing images. Features includesize,patternonanimals,backgroundimagestypeof animal,colorofanimal,nightlightetc.Thedetectionclass animalscontaintwovalues:animalandempty.Thedataset isunbalancedbecauseitcontains400casesof“animal”class by97.5percentand10casesof“empty”by2.5%.

A. Data Preprocessing

The proposed system applies the method of data preprocessing for finding the good quality images and droppingthebadqualityimagesandtransformingtheclass label to preprocessed image. The preprocessing stage included converting the images into 3D and 4D tensor imagesforspatialreduction.Thiscanhelptoaddcolortothe imagespresentin2Dtensor.4Dtensorcanbeusedtoadd samplesizeforanyblackandwhiteimages.3Dtensorisa cubeandrepresentsanarrayofarraysofarrays.Tensorscan beusedtoencodemulti dimensionaldata.Tensorscanhelp ustodiscoverhiddenrelationshipsthatahumandidnotsee inthedataandcouldnotprogramasafeature.

B. Building Model

TheProposedsystemusesthemodelofALexNet,totrainthe model using Sequential layer, Convolution2D layer, MaxPoolinglayerandActivationlayer.Sequentiallayerisa inputloadoflayerswhereeverylayerhasoneinputtensor andoneoutputtensor.Convolution2Dlayerappliessliding convolutionalfiltersto2 Dinput.Maxpoolingisapooling operationthatchoosesthemaximumelementfromthearea of the feature map enclosed by the filter. An activation function in a neural networkdescribes how the weighted sumoftheinputisconvertedintoanoutputfromanodeor nodesinasheetofthenetwork.

C. Prediction of Animal

Theproposedsystemtakestheinputfromtheuserandloads thepretrainedmodeltoefficientlypredicttheanimals.

D. Bounding Box formation with the count:

The proposed system uses computer vision techniques to detect common objects to build a bounding box and then givethecountofanimalsthatispresentintheboundingbox whichisformedaccordingly.

E. Sending Messages:

TheproposedsystemusestheTwilioAPItosendmessageto theuserabouttheanimalandcountwhichisformedusing theconceptofboundingbox.

5. Results and Discussion

Thedataisdividedinto70%fortrainingand30%fortesting andvalidation.TheconversiontoTensormethodselected inapplicable subset features. Then, the proposed features were processed by engaging classifiers for detection of wildlife. It is stated that the planned system has realised promising results. The proposed system uses AlexNet algorithm for discovering the best relationships between each feature with the target features and works to hierarchizethefeaturesandachievepercentagevaluesfor every feature based on the correlation with the target feature. The proposed system and the model used here returned an accuracy of 92% by AlexNet and 89.3% by ResNet. The system also sends a message or alert to user displayingthenumberofanimalsandtypeofanimal.

Fig 4 Snapshot 1

Fig 5 Snapshot 2

© 2022,
|
|
Certified Journal | Page732
IRJET
Impact Factor value: 7.529
ISO 9001:2008

International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056

Volume: 09 Issue: 07 | July 2022 www.irjet.net p ISSN: 2395 0072

6. CONCLUSION AND FUTURE ENHANCEMENTS

Thisprojectdealswiththepredictionofwildlifeon roadsandforests.Outofthe610imagespresent410best train images are taken for prediction. Prediction is done usingthedeeplearningtechnique,CNNwhichhasAlexNet and ResNet architecture present. In this classification problemCNNclassifiestheoutputintotwoclasswithanimal andwithoutanimalingiventestimage.Themainobjective of this study was to predict animals using less number attributes while maintaining a higher accuracy. Here we obtainanaccuracyofabout93%.Themodelwhichweused heregaveanaccuracyof85to92percent.UsingMATLABfor templatematchingalgorithmshowedthattheaccuracyfor 80%whichwasnotfeasiblewithFscoreupto0.23.

Thisworkcanbemoreextendedbyaddingcamera beforethemodelforcapturingrealtimeimages.

REFERENCES

[1]:Yu,X.,Wang,J.,Kays,R. et al. ‘‘Automatedidentification of animal species in camera trap images”. J Image Video Proc 2018,52(2018).https://doi.org/10.1186/1687 5281 2018 52

[2]: Willi, M., Pitman, R. T., Cardoso, A. W., Locke, C., Swanson, A., Boyer, A., Veldthuis, M., & Fortson, L. F.(2019).Identifyinganimalspeciesincameratrapimages usingdeeplearningandcitizenscience. Methods in Ecology and Evolution, 10(1),80 91.https://doi.org/10.1111/2041 210X.13099

[3]:Parikh,M.,Patel,M.,&Bhatt,D.(2019).AnimalDetection UsingTemplateMatchingAlgorithm.

[4]:Shetty,Singh,Shaikhetal.AnimalDetectionusingDeep LearningVol.11.1 32021.

© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page733
Fig- 6 Snapshot-3 Fig 7 Snapshot 4 Fig 8 Snapshot 5 Fig 9 Snapshot 6

International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056 Volume: 09 Issue: 07 | July 2022 www.irjet.net p ISSN: 2395 0072

[5]: Schindler, F., & Steinhage, V. (2021). Identification of animals and recognition of their actions in wildlife videos using deep learning techniques. Ecol. Informatics, 61, 101215.

[6]:H.Nguyen et al.,"AnimalRecognitionandIdentification with Deep Convolutional Neural Networks for Automated WildlifeMonitoring," 2017 IEEE International Conference on Data Science and Advanced Analytics (DSAA),2017,pp.40 49, doi:10.1109/DSAA.2017.31.

[7]: Sanjay, S., Balamurugan, S. S., & Panigrahi, S. S. (EasyChair,2021).AnimalDetectionforRoadSafetyUsing DeepLearning.EasyChairPreprintno.6666.

[8]:Verma,Gyanendra&Gupta,Pragya.(2018).WildAnimal Detection Using Deep Convolutional Neural Network. 10.1007/978 981 10 7898 9_27.

2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal

Page734
©
|

Turn static files into dynamic content formats.

Create a flipbook