Elephants are the largest land mammals that roam on the face of Earth and have distinctively enormous bodies, ears and long trunks. In Sri Lanka, my motherland, elephants hold symbolic, cultural and economic importance and have special significance in religious events. Sadly, a number of issues are threatening the elephant population. According to WWF, the greatest threat to African elephants is wild crime whereas the greatest threat to Asian elephants is habitat loss, leading to Elephant - Human conflict. Due to their shrinking habitats, Asian elephants are now listed as 'Endangered' by IUCN (International Union for Conservation of Nature).
Poaching and Elephant-Human conflicts are the some of the most threatening issues so monitoring them could help us prevent danger to elephants. Elephants have poor hearing and can communicate in low -frequency sounds which are below the hearing frequency range of humans.
They have different types of calls - such as laryngeal, trunk, imitated and novel calls - which they express at certain situations when they are aggressive, startled, threatened, etc. Humans may not be able to differentiate between these calls and predict the situation at which the elephant is at the moment, but an accurate machine learning model has the ability.
I have decided to build a Machine learning model using Edge Impulse studio and utilised the dataset which I created with the help of Elephant Voices database. I have used calls associated with group defense, musth behaviour and conflict for my ML model.
The ML model can be deployed as an audio classification model in the elephant collar which will be worn by elephants in the particular reserve and even in forests. The device would not need any internet connection and runs with minimal power consumption.
Read on further to learn more about this project. My final and complete idea is presented in the last section.
Group DefenseElephants are usually found in herds and usually look after one another and protect themselves from threats.
According to Elephant Voices, calls associated with anti-predator behavior include those used in the context of alerting companions to the presence of a predator, intimidating or "mobbing" a predator, as well as those used while taking defensive action. Family members produce several different call types when they confront predators or when they find themselves in potentially threatening or frightening situations. These include rumbles, snorts, trumpets, and roars. Much has been written about the complex and highly coordinated defensive and offensive behavior of elephants in the presence of predators, but the variety of calls produced, and the dramatic responses of other elephants to these calls has received little attention.
When exposed to the sound, sight and smell of lions, hyenas, humans, or other potentially dangerous predators or situations, females and calves typically respond by first freezing, then rapid assembly (rapid walking or running toward one another) and then bunching. Once elephants have assessed the level of danger presented, they may attack enmasse or make a hasty retreat. Their particular response appears to be communicated, in part, via fine-tuned acoustic signaling.
We can use Edge Impulse to identify certain calls and help us understand about the situation which the elephant, wearing the collar, is facing at the moment.
Musth behaviourMusth is a normal periodic condition in male elephants characterized by highly aggressive behaviour and accompanied by a large rise in reproductive hormones. Individual males come into musth at a specific time each year and their activity during this period greatly influences the elephant society as well as man-elephant interaction. They can be dangerous and it's essential that we monitor them while they undergo this condition.
Using the RFID microchip and Simultaneous RFID reader, we can calculate how far a musth elephant is from the area of risk. Using Ultra-high frequency antennas could help extend the range over which an RFID microchip could be detected. By calculating the distance, we can predict whether the elephant is approaching the area or not. We can also monitor its behaviour to assess the risk associated with this conflict. People residing in that area can be alerted by turning on a beacon light as soon as an approaching musth elephant is detected.
ConflictAccording to Elephant Voices, elephants are less likely to come into conflict over resources in habitats where food, water and minerals are both plentiful and relatively evenly distributed but in the opposite situations, conflict between elephants can be intense and vocalisations associated with agonistic behaviour are more frequent. Furthermore, as human populations increase many elephants must compete for access to resources with humans and livestock as well as other elephants.
Lack of, or diminishing, resources is only one source of conflict. Males threaten one another, and may even fight to the death, over musth status and access to receptive females. Young males hold sparring matches to gain experience and to test one another's strength, and such playful jousting occasionally turns aggressive. Teenage males, who have reached the same size as adult females, begin pushing their weight around, learning that they can pick on females who are older, yet smaller than themselves. This sort of behavior is not tolerated and may elicit an aggressive attack by a matriarch or by a coalition of females.
Due to the competition for resources, human-elephant conflict has grown into a huge issue and it poses a threat to the diminishing elephant population. It is also one of the biggest environmental and socio - economic crises of rural Sri Lanka. Elephant - Human conflict is rising as more and more elephants come into close contact with humans. This often leads to elephants destroying crops and properties, as well as occasional human casualties. These negative interactions can result in the retaliatory attack/killing of elephants.
In the first 10 months of 2019, 93 humans and 293 elephants have already been killed in this conflict, compared to the death of 96 humans and 319 elephants for the whole of 2018 in Sri Lanka. This is increasing and the government is working on different types of solutions to prevent this problem.
Monitoring elephant's behaviour and calls can help us predict such conflicts and save both species from each other. With an accurate Machine Learning model, we can successfully predict the conflicts and alert humans in the areas at risk. This system could also be automated such that a beacon light could be turned on once the conflict is predicted.
Edge ImpulseIn this project, we will be using Edge Impulse studio to build a Machine Learning model and we can create a dataset using the Elephant Voices database.
To make this project easier, please follow Edge Impulse's guide about recognising sounds from audio.
I have not used any devices to capture data. Instead, I created a dataset using the sounds from Elephant Voices database. I have used the sounds from Group Defense, Male-Male Competition (During Musth condition) and Conflict. I downloaded Jungle and Savannah sounds from YouTube to come under 'Noise' label.
I have created a dataset under four labels: Conflict, Group Defense, Musth and Noise.
After creating my training dataset, I designed an impulse. An impulse takes the raw data, slices it up in smaller windows, uses signal processing blocks to extract features, and then uses a learning block to classify new data. Signal processing blocks always return the same values for the same input and are used to make raw data easier to process, while learning blocks learn from past experiences.
For this project, we will be using "MFCC" signal processing block which extracts features from audio signals using Mel Frequency Cepstral Coefficents, and is great for human voice.
Then pass this simplified audio data into a Neural Network block, which will learns patterns from data, and can apply these to new data and classifying them. This is great for categorizing movement or recognizing audio.
Do not change the default parameters during the configuration.
Scroll down and click 'Save parameters'. This will redirect you to the 'Generate Features' page.
Click on 'Generate Features' and scroll down. You will see something similar to this:
Creating job... OK (ID: 314642)
Job started
Creating windows from 69 files...
[ 0/69] Creating windows from files...
[ 1/69] Creating windows from files...
[ 1/69] Creating windows from files...
[13/69] Creating windows from files...
[43/69] Creating windows from files...
[69/69] Creating windows from files...
Created 1677 windows: Conflict: 127, Group Defense: 663, Musth: 62, Noise: 825
Scheduling job in cluster...
Job started
Creating features
[ 1/1677] Creating features...
[ 696/1677] Creating features...
[1391/1677] Creating features...
[1677/1677] Creating features...
Created features
Scheduling job in cluster...
Job started
Reducing dimensions for visualizations...
UMAP(a=None, angular_rp_forest=False, b=None,
force_approximation_algorithm=False, init='spectral',
learning_rate=1.0,
local_connectivity=1.0, low_memory=False,
metric='euclidean',
metric_kwds=None, min_dist=0.1, n_components=3,
n_epochs=None,
n_neighbors=15, negative_sample_rate=5,
output_metric='euclidean',
output_metric_kwds=None, random_state=None,
repulsion_strength=1.0,
set_op_mix_ratio=1.0, spread=1.0,
target_metric='categorical',
target_metric_kwds=None, target_n_neighbors=-1,
target_weight=0.5,
transform_queue_size=4.0, transform_seed=42, unique=False,
verbose=True)
Construct fuzzy simplicial set
Sun Oct 18 01:29:25 2020 Finding Nearest Neighbors
Sun Oct 18 01:29:27 2020 Finished Nearest Neighbor
Search Still running...
Sun Oct 18 01:29:30 2020
Construct embedding
completed 0 / 500 epochs
completed 50 / 500 epochs
completed 100 / 500 epochs
Still running...
completed 150 / 500 epochs
completed 200 / 500 epochs
completed 250 / 500 epochs
completed 300 / 500 epochs
completed 350 / 500 epochs
completed 400 / 500 epochs
completed 450 / 500 epochs
Sun Oct 18 01:29:37 2020 Finished embedding
Reducing dimensions for visualizations OK
Job completed
Step 04: Neural Network configurationNow, it's time to start training a neural network. Neural networks are algorithms, modeled loosely after the human brain, that can learn to recognize patterns that appear in their training data. The network that we're training here will take the MFCC as an input, and try to map this to one of four classes—conflict, group defense, musth and noise.
I had to train my model around 3 times with different options. My first trial gave me an accuracy of 65.2% when the number of training cycles was 100. I used the 2D Convolutional architecture preset. I retrained my model and this time, I increased the number of training cycles to 300. I got an accuracy of 67.3%.
Finally, I got an accuracy of 76.5% when I retrained my audio classification model with 300 training cycles and default architectural preset.
The accuracy of this Machine Learning model can be improved by acquiring more data and we need to have minimum 10 minutes of data for each label.
You can test the validity of your model by this model testing. I tested 13 samples and my model recognised just one. If I had more data under each label, this ML model would be more accurate.
Step 05: DeploymentThe ML model is now ready for deployment. This makes the model run without an internet connection, minimizes latency, and runs with minimal power consumption. You can either create a library or build firmware for your development board.
I have turned my audio classification model into optimized source code that can run on any device, for example: STMicroelectronics MP23ABS1 .
The device can be connected to the elephant collar and be implemented to prevent danger and threats to the diminishing elephant population.
Final and complete ideaTo make things more interesting and effective, an RFID microchip could be fitted to the elephant collar or a passive RFID tag can be attached to the elephant's ear. Each elephant will have a unique ID and with the help of Ultra High frequency antennas and Sparkfun's simultaneous RFID readers, we would be able to detect when the elephant is within a safe distance away from poaching risk areas or places where people reside. Simultaneous RFID readers are capable of reading multiple tags simultaneously. If the elephant is approaching, the RFID reader will be able to detect as it can calculate the distance between the certain RFID tag and the reader. If the elephant is at risk, the park or forest rangers can take the appropriate actions.
The RFID reader can be connected to the microcontroller at around 1 or 2 km away from areas where people live or where poaching activity is high. If the system detects an approaching elephant, the microcontroller is programmed to automatically turn on a beacon light and alert the people residing in that area.
This would also be helpful if the Machine Learning model fails to recognize sounds from the audio recorded by the microphone in the collar or elephant collar's battery has run out of power or if it malfunctions.
Comments