Automated Elephant-detection system

Real-time machine-vision based detection of elephants in rural areas: providing warnings to locals and thus prevent human-elephant conflict

Similar projects worth following
Human-elephant conflict (HEC) is a major cause of death and injury for both elephants and humans. Primary sources of conflict: elephants raiding human crops, unexpected encounters between humans and elephants as elephants traverse their established trails, elephants crossing railway lines. One way to prevent HEC is to automatically detect elephants & alert villagers, or train-drivers, to their presence via SMS, cloud-based apps, or LED signs.

In this solution:

1. Cameras mounted on poles or trees will obtain images of elephants
2. Compare images with known images of elephants
3. If probability of match higher than threshold, then notify village base station, and thus villagers

How can we solve the challenge of detecting elephants in order to provide local people with advance warning of their presence? Advance warning being particularly useful in that it can: a.) prevent people stumbling upon elephants unaware and spooking them b.) allow interception of crop-raiding elephants before they reach the crops (this is thought to be safest and easiest time to deter them). Early detection of elephants will mitigate human-elephant conflict, thus preventing death and injuries of both elephants and humans.

This short video from shows elephants launching their crop-raiding mission during the night,and the local people trying to scare them away.

In this solution, small weatherproof cases containing required elephant-detection system (elephant detection device) hardware will be tree- or pole-mounted in locations previously identified as being known to be passed by elephants. These locations could be a) interfaces between forests and farmland b) elephant pathways (these are the established trails that elephants use to move between, for example, forest and watering areas c) frequent railway-line crossings.

The elephant-detection system (elephant detection device) hardware will comprise [see them here]:

  • Raspberry Pi 3
  • camera module
  • communication via RF [or can make use of 3G if we are lucky enough to have coverage/ or GPRS as outlined in this log] short-range (120m) using XBee 2mW RF transmitters for sending to the field transmission stations
  • storage for image database (SD card)
  • solar panels and associated components
  • PIR sensor

It's imperative that the elephant-detection device is of very low-cost (<£100), as multiple devices will be required, and the budget of villagers affected might not be very high. The purpose of an elephant-detection system being open-source, is so that villagers can access plans, download software, purchase components, and assemble the system themselves; placing detection devices where they expect elephants!

How do we detect an elephant from the images that the camera obtains?

The most challenging part of the project is comparison of taken images of suspected elephants with known images of elephants! This would be quite easy if using MatLab, but this is not open-source and it's very expensive! Instead, I'm using OpenCV in Python to either compare histograms (the fastest and least intensive re processing & resources) or to feature match (slower and more resource intensive). This processing will be accomplished using the Raspberry Pi's on each elephant detection device, and the detection results will be transmitted via RF to the field transmission stations, and then onwards to the village base station.

I've outlined the different methods I'm testing in the following project logs:

This is an example overview of software and hardware activity on the elephant detection device, and the outcomes that positive and negative results of elephant detection would trigger. In this example, the histogram comparison method was employed:

Example placement of elephant-detection system components

As an example, I have used Sansiajang, Odisha, India. This village was identified in 'Human-Elephant Conflict: Case Study from Balasore and Rairangpur division of Mayurbhanj Elephant Reserve, Odisha, India' as being afflicted by human-elephant conflict.

As can be seen from the map, Sansiajang is surrounded by agricultural land, and has a large forest to the north, which is where elephants may wait before launching their crop-raiding missions. The elephant detection devices of the detection system would be placed at this interface between the forest and the agricultural land. The detection... Read more »

  • 1 × Raspberry Pi 3 Model B Used for elephant detection device, field transmission station and village base station
  • 1 × Raspberry Pi 5MP Camera Module -> CSI interface on Pi (For Elephant Detection Device) £18.52
  • 2 × XBee 2mW Wire Antenna - Series 2 (ZigBee Mesh) Used for elephant detection device, field transmission station
  • 2 × SparkFun XBee Explorer Dongle (XBee -> USB -> Raspberry Pi) Used for elephant detection device, field transmission station
  • 1 × Long-range RF Modem Used for field transmission station and village base-station; Similar to XTend 900 1W RPSMA

View all 12 components

View all 20 project logs

Enjoy this project?



guhan.atkumar wrote 01/10/2017 at 06:56 point

Hi Neil, Your project is really good. I am trying to implement something similar to your project,in my case i'm from India and there are hundreds of elephants dying every year in accidents that happen due to trains passing through forests, can i implemet something like your project but all i need is to detect elephants and inform them to the near by train station or trains so that they could be warned to travel in a way slower speed ?.Will this be possible in a way cheaper price with just using motion sensors alone,if so can u please explain me about this and how about using dual infrared sensors parallel to train tracks?

  Are you sure? yes | no

Neil K. Sheridan wrote 03/03/2017 at 22:09 point

hi, ah I figure yes you could just have IR beam break circuit to do it,  parallel to train tracks in regions that elephants are known to cross. You could mount them on poles above human and other animal height so only elephants break the beam. Then use a modem like Huawei E303 to just SMS the train drivers to slow down. Yeah, it'd be way cheaper than using PIR in this context - since you just make a 'fence' of IR beams alongside the tracks. I've not seen anything greater than a 10m IR beam break circuit so I don't know how many multiple circuits you would need to make. Here's one somebody made for camera traps anyway

I imagine you could do a similar break circuit with a LASER too, that would have a much greater range than 10m! I don't know much abt costing but will look into it as it might be useful trigger for elephant detection devices vs. PIR.

  Are you sure? yes | no

Neil K. Sheridan wrote 03/03/2017 at 22:30 point

Actually I was just thinking.. there is another way to do this: instead of warning train drivers, we could warn the elephants of approaching trains. So we'd get an IR break beam circuit say 20km from the elephant crossing area, and when a train passed and broke the beam, we'd trigger a device at the elephant crossing point to make a certain sound that the elephants would associate with incoming danger. It's not great, because the elephants would have to see their friends hurt before they associated the noise with danger [:-(], but it would make a really low-cost addition to a protection system for elephants crossing the railway.

  Are you sure? yes | no

Em Bedd Hu Man wrote 05/02/2016 at 23:33 point

Hey Neil, I really like this. You know, I'm working on something similar, but not for elephants.

So I think your PIR sensor won't do much good because the cheaper ones have a 7 metre max. range. I've seen ones w/35 metre range but the price is aprox 60 USD. The camera will be able to see much farther. I also don't know the temperature over there, but I've run them in humid jungle temps and at anything above 35 or so they're unreliable.

In my experience w/opencv in RPi2b, it's extremely resource intensive and requires a lot of battery. I was using the C api so can't speak for python, but I was doing blob detection based on color & size using video. In short, it works, but it's a very expensive operation. Best to have power coming from a wall. I see you are using histograms based on images, which I'm not familiar with but sounds much more resource friendly than video operations.

Also, w/that small battery how do you expect to get more than a few hours out of that?

I think ideally you can use a gsm modem such a huawei e303 or similar zte model, both of which should have low power modes & are quite cheap. If you're interested I can also donate some C code I wrote that provide remote administration via SMS in a very resource friendly way, on a beaglebone green it idles @ .1 % cpu usage so on a Rpi3 it should be a good bit less.

Be sure to keep the updates coming, I am very interested to see how it performs in the wild. Thanks!

  Are you sure? yes | no

Neil K. Sheridan wrote 05/03/2016 at 11:15 point

Hi! Thanks! 

Ah, now I had not thought of that regarding the range of the PIR sensor! Thanks for bringing it up..  I'll have a look and see if I can find some lower cost long-range ones..

Glad to hear it works using the Raspberry Pi! Yes, I was worried it will be dreadfully resource intensive - I just hope the histogram method  will be accurate enough but I don't know..

Yeah, I'll have to move to a bigger battery for sure - that one is only for my prototype really. Thanks that would be great abt the code - I'll get back to regarding it when I progress to that stage :-) Thanks for tip re modem too; e303 is much cheaper than the one I found so far..

For sure I think there will be lots of ahem, 'interesting' problems when I test it in the wild !!

  Are you sure? yes | no

Yours Truly wrote 04/22/2016 at 15:47 point

Awesome project! Are you planning to integrate flashing lights and/or audio in order to scare away the elephants before they reach the crops?

  Are you sure? yes | no

Neil K. Sheridan wrote 04/22/2016 at 18:35 point

Thank you! :-) Yes, actually I was considering that! I was thinking of adding audio towers which would play random (so elephants didn't get used to them) sounds of tigers or bees..

  Are you sure? yes | no

Rimgar wrote 04/19/2016 at 19:39 point

Following a different approach using micorphones for detecting elephants, you might be interested in the research of Zeppelzauer et al.

  Are you sure? yes | no

Neil K. Sheridan wrote 04/19/2016 at 20:08 point

thanks! I had heard of that technique, but haven't seen the paper you linked..

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates