Wildfire Area Prediction: An AI Approach to a GIS Problem
By: Kirti Girdhar
Tags: Machine Learning, Artificial Intelligence, GIS, Data Science, Forest Fires

Performing Exploratory Data analysis

There are 39 features in the dataset that we are using amongst which most of them are unique identification numbers used by different agencies and do not provide any information about fire. Therefore, we would remove those features right away after which feature analysis is performed on every individual feature to analyze their in our model.

Analyzing our class label: FIRE_SIZE_CLASS feature

The feature is first encoded manually to ‘int’ data type to facilitate machine learning model computation. Here different classes of fire size indicate different fire area sizes (in acres) as given below:

1/A: 0–0.25 acres

2/B: 0.26–9.9 acres

3/C: 10.0–99.9 acres

4/D: 100–299 acres

5/E: 300–999 acres

6/F: 1000–4999 acres

7/G: 5000+ acres

As seen in the graph, dataset is highly imbalanced with maximum reported incidents lying in Class 2.

Features such as OBJECTID, FOD_ID, FPA_ID are removed as they do add any value to the model.

Analyzing feature: SOURCE_SYSTEM_TYPE

Code snippet for individual feature analysis is as follows:

Feature Analysis Code

The feature is then encoded to a numeric value using ‘Label Encoders’ after which graphical analysis is performed.

Observation:

For each of the fire size class, maximum fires are associated with source system type = 2 which is ‘INTERAGCY’ and minimum fires in each class associated with source system type = 1 which is ‘NONFED’.

Therefore, this feature would be useful for our model.

Analyzing feature: SOURCE_SYSTEM

Similar statistical analysis is performed for each feature as shown in the above code snippet. The graphical analysis of this feature is as follows:

Observation: The X- Axis values of this plot re overlapping but we can clearly observe than most of the box plots have their 25–75%values lying between fire classes 1 and 2. This observation can be an effect of huge data imbalance which can be avoided by adding weight to each fire class during modeling.

Analyzing feature: NWCG_REPORTING_AGENCY

Observation: In most of the Box Plots, the median line is overlapping with the 25th/75th percentile lines. Most agencies have been reporting fires of size lying in class 1,2,3 but Agency 3 has 25–75% reported incidents lying in fire size class 5,6 and agency 4 between class 6 and 7.

Features such as ICS_209_INCIDENT_NUMBER, MTBS_ID, MTBS_FIRE_NAME are again removed as they were not important for the prediction.

Analyzing feature: FIRE_YEAR

Observation: Year 2006 has seen maximum forest fires not just class 2 fires but also Class 1 and Class 3 are visibly higher than any other year. More recent years i.e. 2014, 2015 show similar numbers which are not as high as 2006.

Since for every year, most of the count values are of fires lying in class 1,2 and 3, for analyzing fires lying in other classes, We can analyze the fires with dataset not having fires of classes 1, 2 and 3. Therefore we would filter out our data, the code for which is given below:

Code for Filtering out Majority classes from Imbalanced Data

Observation: This is a graph of filtered data such that the data contains only fires of classes 4,5,6,7. After analyzing the filtered data, we observe that in 2006, even the fires of bigger sizes are much more than other years. Fires of class 7 (biggest size) are the largest in years 2006, 2007, 2011, 2012 and 2015.

Feature DISCOVERY_DATE is present in Julian format, it can be converted into YYYY-MM-DD format for better understanding but we already have Discovery Year, Discovery Day of Year from which we can get the month of forest fire and after that we have discovery time which can be used to find out at which interval of the day did the fire occur, therefor this feature would not add any value to our dataset and can be discarded.

Analyzing feature: STAT_CAUSE_CODE

Observation: When the fire cause code is 1: we have maximum fires of size 1. In fact, these is a probability of fires from all 7 size classes to be present in it, on looking at the STAT_CAUSE_DESC feature we realized that class 1 is actually ‘Miscellaneous’ therefore it makes sense. For causes of class 10 (Powerline), very less fires are cause due to it as the count is very small and even when the fires are cause, the fires are only of class size 1 or 2 i.e. small fires. Similarly cause 12 (Fireworks) has the least number of instances and only in class 1 and 2. For class 9 (Smoking) we can see fires of class 3,4,5 and 6 along with 1 and 2 i.e. smoking can cause huge fires and is a much more dangerous cause.

Containment features such as CONT_DATE cannot be present for current fires therefore removing all containment information.

Analyzing features: LATITUDE and LONGITUDE

Geographical analysis of forest fires based on coordinate values is done by plotting heatmaps using the code below:

Code for creating heatmap of Forest Fires

Observation: Lighter color means more wildfires (as given in the legend). This is a view of all 52 states in the U.S. which include both the continent part and the main land U.S. To get a better visualization of wildfires in mainland U.S., we can remove the continent states data from our data frame i.e. states = Hawaii, Alaska and Puerto Rico (Reference taken from world map)

Heatmap for data filtered for U.S. mainland

Observation: This is just the forest fires visualization in U.S. mainland. Taking reference from U.S. map, we can see a lot of forest fires in California (left corner)

Regions like Montana, Nebraska, Colorado, Indiana, Illinois have very less cases of forest fires and most of them are darker in shades i.e. the count of forest fires is very less there. Then again in regions at right bottom corner i.e. Virginia, North and south Carolina, Georgia, Florida, Alabama there are so many forest fires as the color is very bright and dense.

We can also represent forest fire counts throughout the years using Folium for better representation through a map (Folium image present in article title). Code for Folium representation is as follows:

Folium Data presentation Code

Similar analysis is performed on features such as COUNTY, OWNER_CODE etc.