Skill Level: Intermediate

This recipe assumes that user already has knowledge on machine learning.

This recipe walks you through the process of building a predictive model.

This is a model, we developed for IBM Call For Code contest in 2019. It will predict disaster/natural calamity or any environmental threat by observing the behaviour of animals.


  1. Abstract

    Our system will predict disaster/natural calamity or any environmental threat by observing the behavior of animals. The system will study the various animal behavior both psychological and physiological factors and the immediate causes/effects in environment. By feeding the machine learning models with various test and training data, the system will be able to predict the outcome of the disaster. The system keeps monitoring various places and the animal behavior in the region. When the behavior of an animal/group of animals differ the normal behavior test data and it reaches a warning threshold, then the system warns the authorities of a possible natural calamity that is expected to happen in the region.

    Use case:

    During the previous night or the previous day of the natural disaster Tsunami, it is observed that a group of animals relocated from lower landscape and migrated to a higher elevated mountain. By observing the animals physiological movement to the selected type of place, it is possible to predict a natural calamity and move people to a safer place much like the place that animals have chosen.



    Researchers believe that animals are able to sense the danger long before humans. On December 26, 2004, an earthquake along the floor of the Indian Ocean was responsible for a tsunami that claimed the lives of thousands of people in Asia and East Africa. In the midst of all the destruction, wildlife officials at Sri Lanka’s Yala National Park have reported no mass animal deaths. Yala National Park is a wildlife reserve populated by hundreds of wild animals including various species of reptiles, amphibians, and mammals. Among the most popular residents are the reserves elephants, leopards, and monkeys.

  2. Architecture




    This is the architecture of this system. Here, a user inputs a CSV file which has the animal behavior data, observed and collected in a CSV file. The CSV file is stored in a Cloud Object storage or Amazon S3 Bucket or any similar storage in cloud. It is fed to a machine learning model that is built using an analytics engine like Apache Spark which analyze the data from CSV file and predicts whether a disaster/natural calamity is expected to happen or not. 



    Development Team:

    Here is the list of team members who developed this model:

    Chenthilraj Lakshmikanthan (

    Malarvizhi Kandasamy (

    Ujjwal Upadhyay (

    Amaresh Dhal (

    Sandhani Shaik (

    Banala Siva Rama Krishna Prasad

    Priyanshi Mahaur



















  3. Implementation

    The machine learning module is developed by Ujjwal Upadhyay: 
    You can find the code for this system here:

    The Machine learning code present at consists of the following steps:

    a. Import pandas, numpy, seaborn and machine learning models like Logistic Regression, SVC, KNeighboursClassifer, Percepton, DecisionTreeClassifer, etc.

    b. Read csv files for Animal Movement and create train_df and test_df panda sets.

    c. Create training and test data set from the above train_df and test_df.

    d. Fit the training data sets in various ML models like LogisticRegression and RandomForestClassifier and then check the accuracy from the predicted data from the model.

    e. Create an appropriate data frame from the test_df and send it to csv file which can then be downloaded.


    The UI is developed by Banala Siva and Priyanshi Mahaur. 

    The python Flask application is developed by Sandhani Shaik. You can find the full working application along with ML code here:

    After you setup the application, access the application as http://<ip-address>/public/Form.html

    You will be provided with a screen shot as shown below :


    The screen captures the species which has moved to an altitude, the distance moved and the animal behavior (found from facial expression, Blood Pressure, etc) whether it is tensed or not.  


    The ML model will analyze the data from inputs and predicts whether a disaster/natural calamity is expected to happen or not as shown below.









Join The Discussion