<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Theo Jaquenoud on Medium]]></title>
        <description><![CDATA[Stories by Theo Jaquenoud on Medium]]></description>
        <link>https://medium.com/@thjaquenoud?source=rss-6eecc6432467------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*diRnOBqpxTAn-3u4ry8hDQ.png</url>
            <title>Stories by Theo Jaquenoud on Medium</title>
            <link>https://medium.com/@thjaquenoud?source=rss-6eecc6432467------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:12:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thjaquenoud/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI Geospatial Wildfire Risk Prediction]]></title>
            <link>https://medium.com/data-science/ai-geospatial-wildfire-risk-prediction-8c6b1d415eb4?source=rss-6eecc6432467------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c6b1d415eb4</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[remote-sensing]]></category>
            <category><![CDATA[deep-dives]]></category>
            <category><![CDATA[wildlife]]></category>
            <category><![CDATA[google-earth-engine]]></category>
            <dc:creator><![CDATA[Theo Jaquenoud]]></dc:creator>
            <pubDate>Tue, 25 Jan 2022 23:41:22 GMT</pubDate>
            <atom:updated>2023-01-06T17:52:00.517Z</atom:updated>
            <content:encoded><![CDATA[<h4>A predictive model using geospatial raster data to assess wildfire hazard over the contiguous United States</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9nOFeLv1dRk-zKqI" /><figcaption>Photo by <a href="https://unsplash.com/@mikenewbry?utm_source=medium&amp;utm_medium=referral">Mike Newbry</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Wildfires are unplanned fire events that occur both naturally and as a result of human activity. In the United States, they are responsible for several billion dollars in costs each year [1], and in 2020, they burned over 10 million acres in the United States alone [2]. Much of the costs come from prevention efforts. For example the state of California recently approved a wildfire prevention budget of over $1.5 billion [3]. Deciding on where to allocate that spending requires knowledge of which areas are at high risk, so in this article, I present a framework for providing up-to-date maps of fire risk using deep learning image processing and geospatial datasets.</p><p>The first section of this article presents some background on the field of <strong>Remote Sensing </strong>as well as the tool <strong>Google Earth Engine</strong> which was used extensively to create the dataset in this project. If you are already familiar with these topics, or just want to skip to the project, feel free to scroll down to <strong>AI Geospatial Wildfire Risk Prediction</strong> which covers <strong>Preparing the Dataset </strong>and training a <strong>Deep Learning Model</strong>.</p><p><em>This project was conducted as part of a graduate level class ECE-471: Machine Learning Topics in Remote Sensing and Earth Observation at The Cooper Union.</em></p><h3>Remote Sensing and Earth Observation</h3><p>For the uninitiated, <strong>remote sensing</strong> is the science of obtaining information from a distance, usually using airplanes or satellites. Often, it is thought of in the context of satellites observing the earth; one common example would be the satellite view on google earth.</p><p>The sensors themselves range from passive sensors, which detect natural light much like a camera, either emitted or reflected, to active sensors, which emit their own energy and observe the reflections, like radar or lidar. The different imaging frequencies of light are called <strong>spectral bands</strong>. Satellites orbit around the earth imaging swaths of land as they go, as portrayed in the video below. Because of this pattern, it takes a certain amount of time to image the entire Earth.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyPF2jpjB3Qw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyPF2jpjB3Qw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyPF2jpjB3Qw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9bc977c7a5e0b675c1449482c376d2bb/href">https://medium.com/media/9bc977c7a5e0b675c1449482c376d2bb/href</a></iframe><p>The period of time elapsed between consecutive images of the same point on earth is known as the <strong>revisit rate</strong>. Generally, there is a trade off between revisit rate (temporal resolution) and <strong>spatial resolution</strong>, which refers to the size of a pixel on the ground. For example, the popular MODIS satellite has about a 2-day revisit rate and a resolution of 250 to 1000 meters depending on the spectral band [4]. For comparison, Landsat-8 has a resolution of 30 meters in the visible light bands, but a revisit rate of about 16 days [5].</p><h3>Google Earth Engine</h3><p>Google Earth Engine (GEE) is a powerful interface that lets you access over thirty years worth of satellite imagery and other geospatial data from anywhere on earth [6]. I highly recommend you <a href="https://developers.google.com/earth-engine/datasets/">explore their datasets</a>.</p><p>In the code below, I show how easy it is to pull some data and plot it on an interactive map. First, you have to sign up for <a href="http://signup.earthengine.google.com/">a developer account with GEE</a>. Make sure you have <em>geemap </em>and <em>ee </em>installed (<em>ee </em>comes preloaded on Google Colab but <em>geemap </em>does not), and authenticate your account. Find the code for a dataset you are interested in, GEE calls these Image Collections. For this demo, I chose MODIS using “MODIS/006/MCD43A4”. This collection contains every image in the public catalog — years of data covering the entire earth — so you need to apply some filters before you can retrieve any images.</p><p>In remote sensing and earth observation, it is common to use <strong>composite images</strong>, that is when you combine multiple images to create a new one. For example if a cloud happens to obstruct a portion of your image on one particular day, taking a median composite over the span of multiple days will give you a clean and cloudless image. Mean and median composites are other common examples, but you can get creative. For example if you are making a flood map, you might try a “wettest pixel” composite using a clever combination of bands that indicate presence of water.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/545fd4a21e572c6432953afeb9f7b606/href">https://medium.com/media/545fd4a21e572c6432953afeb9f7b606/href</a></iframe><p>Running the above code in a Jupyter environment like Colab will pull up an interactive map like the one below. In just a few lines of code, we have access to satellite images of the entire earth! Here is a median composite of the contiguous United States (CONUS) in June of 2020. Note that this particular image collection does not show the open ocean, the lighter blue on the edges is just the default map in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*j7-8CFGUzd-1DHFHgtQhmA.png" /><figcaption>MODIS imagery over the contiguous United States, June 2020 [4]. Visualization by author.</figcaption></figure><p>GEE also lets you export these images in common formats including geotiff. You can specify the resolution, projection, and a region of interest which can be defined using formats like geojson. This will come in handy for creating a dataset formatted for Machine Learning (ML).</p><p>Lastly, it is hard to talk about processing geospatial datasets without bringing up GDAL [6], but this tool is incredibly powerful and can get really complicated really fast! Rather than dive into it here, I’ll link you to an excellent <a href="https://medium.com/planet-stories/a-gentle-introduction-to-gdal-part-1-a3253eb96082">3 part tutorial by Robert Simmon</a> [7].</p><h3>AI Geospatial Wildfire Risk Prediction</h3><p>The goal of this project is to use the expansive geospatial datasets available on GEE to create a map that rates wildfire risk and danger levels across the United States. Approaching this as a pixel-wise classification problem, there are two big steps to discuss. First is the <strong>preparation of the dataset</strong> which involves: the selection of input geospatial data, annotation of training labels, and preparing the data for ML using GIS software. Second is the training of a <strong>deep neural network</strong> to perform the pixelwise-wise classification, also called semantic segmentation. Finally, we can visualize the results and discuss the model’s performance.</p><h3>i) Preparing a Dataset</h3><h4>Input: GEE Datasets</h4><p>The input dataset consists of various geospatial data from the GEE catalog. The first and perhaps most straightforward image collection for this task was <strong>MODIS </strong>(shown above) [4], whose seven optical bands provide daily coverage of the United States at a resolution of 500m. It was chosen due to its high revisit rate which will allow the wildfire hazard prediction tool to be regenerated weekly.</p><p>The second catalog is a collection of meteorological data derived from <strong>GRIDMET</strong>, the University of Idaho’s Gridded Surface Meteorological Dataset [9]. The data are available daily at a resolution of 4000 meters, and contains information like maximum surface temperature, minimum humidity, standardized precipitation index (SPI), and Evaporative Demand Drought Index (EDDI).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tEMk7OFaYVhLNOTg60B1Rw.png" /><figcaption>GRIDMET maximum surface temperature over the contiguous United States [9]. Visualization by author.</figcaption></figure><p>The third catalog we considered was the <strong>LANDFIRE </strong>mean fire return interval (MFRI) [10]. Assembled by the U.S. Department of Agriculture’s Forest Service, and the U.S. Department of Interior’s Geological Survey, this map categorizes each 30 meter pixel based on the average number of years between wildfires using historical trends. The values are presented as categorical data, binned in 5 year intervals. While this map was only published once, the nature of the data keeps it relevant even several years later. The problem here of course is that this layer of input data will not change over time, but it should still help the model learn regional trends. In other words it is very useful for increasing spatial accuracy, but not for temporal accuracy. This tradeoff is discussed in more detail in part (iii).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YcEDf3sTp9rY_PxiKQRpsw.png" /><figcaption>LANDFIRE mean fire return interval over the contiguous United States [10]. As presented in this map, darker spots see fires more frequently. The map says nothing about the severity of fires. Visualization by author.</figcaption></figure><p>The forth and final collection considered for the input dataset is the USDA National<strong> Agricultural Statistics Service Cropland Data</strong> Layer [11]. It is a 30 meter resolution land cover classification map, classifying each pixel into one of over a hundred categories corresponding to different crops as well as various non-cultivated land types. This dataset will prove useful due to the way we measure wildfire hazard, which considers croplands to be “non-burnable,” in the same category as perennial snow/ice and bare ground. This may lead to some land that is difficult to classify, as it might <em>appear</em> burnable, but wouldn’t be considered so by our dataset. To counteract this, we manually created a binary mask categorizing each pixel as either cultivated or non-cultivated. <em>(in the end we notice that the model actually performed just as well, if not better, without this additional layer)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*ysvLu2lkbwYW_U-BR5VsDA.png" /><figcaption>National<strong> </strong>Agricultural Statistics Service Cropland Data Layer [11]. Though we implemented a binary layer for cultivated and non-cultivated land, this map shows all the available categories. Visualization by author.</figcaption></figure><h4>Output: Wildfire Hazard Potential</h4><p>Having a bunch of data to predict fires is great, but how are we going to learn <em>what</em> is actually correlated to fire risk? We need some reference map that quantifies fire danger. Obviously we can’t use images of places that did burn, because that doesn’t tell us much about the conditions preceding the fire. We considered finding regions that burned, mapping out their boundaries, and considering the weeks preceding the fire to be examples of high fire danger. While this approach could have good results, manually searching for fires and scripting a way to recover images from before the fire would be tedious, and would likely limit us to hot-spots like California. Furthermore, there would be no nuance for severity of fires.</p><p>Searching for an alternative fire hazard dataset, we came across this, the USDA Forest Service’s <strong>Wildfire Hazard Potential </strong>(WHP)<strong> </strong>map [12].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q4vonRvcsmAs0XKpBeLdhw.jpeg" /><figcaption>2020 Wildfire Hazard Potential map “to depict the relative potential for wildfire that would be difficult for suppression resources to contain” [12]. Image by USDA Forrest Service</figcaption></figure><p>The WHP map is a raster geospatial dataset produced to “help inform evaluations of wildfire hazard or prioritization of fuels management needs across very large landscapes.” The goal is not just to quantify how likely wildfires are, but also to take into account how intense, destructive, and hard to contain they would be.</p><blockquote>“Areas mapped with higher WHP values represent fuels with a higher probability of experiencing torching, crowning, and other forms of extreme fire behavior under conducive weather conditions.” [12]</blockquote><p>The map was published as a geospatial dataset for three years: 2014, 2018, and 2020. It is available either as categorical values, with 5 levels of fire hazard (very low, low, moderate, high, and very high) and 3 other categories (non-burnable, water, and developed), or as continuous integer values. While it is not available as part of the GEE catalog, the dataset is in the public domain and we were able to download it from USDA research data archives.</p><h4>Processing: Preparing data for ML</h4><p>We now have several input datasets that can be easily combined for both training and running models, as well as an output dataset that can serve as labels for supervised learning algorithm. Great! But one crucial step is still missing, the data is not at all formatted for ML. Especially not for algorithms designed for image processing.</p><p>The first thing we have to do is filter all the raster datasets by month and make sure they are properly lined up, in the same coordinate reference system (CRS), and at the same resolution. This is made rather simple with GDAL and the <em>gdalwarp </em>command. We chose the common <a href="https://epsg.io/4326">EPSG:4326</a> as our CRS (it is used in GPS), and 500 meters as our resolution. (<em>Technical note: when resampling a categorial raster datasets, make sure to use “near’ , “mode,” or similar resampling algorithms which preserve input values, NOT “bilinear”, “cubic”, etc…</em>)</p><p>The second step is to cut up the entire CONUS into smaller images which can be processed by a deep learning model, and pair up the feature images with their labels. For the model to work, all input images must be of the exact same size, which is harder than it sounds when working within the quirks of projection systems — there are millions of ways to flatten spheres, and none of them are really that good! We used the online tool G<a href="https://cityofaustin.github.io/geojson-grid/">eoJSON Grid Creator</a> to generate a grid that perfectly tiled the United States, then manually removed any squares outside of US borders. We aimed for each tile to be roughly 256km across, or 512 pixels at 500m per pixel. The final grid pictured below contains 177 tiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*3qTa9oaZ4iNUwXKFJQ_XNA.png" /><figcaption>Full grid across the CONUS. Tiles are approximately 256x256km. Image by author.</figcaption></figure><p>With the grid ready, we can now loop through every tile in the dataset and export the region as a geotiff with each of the feature layers stacked, along with a paired geotiff with the labels of the WHP map. We did this using median composites over three summer months (the height of the fire season in most of the country), June, July, and August, for each of the three years the WHP map was available, 2014, 2018, and 2020. The final dataset contains images with 13 layers of geospatial data over the entire CONUS 9 times over.</p><h3>ii) Deep Learning Model</h3><h4>What is the goal?</h4><p>Before we get into the model, I want to quickly talk about our objectives. Our initial goal was to have an algorithm that could generate wildfire risk maps weekly over the CONUS. We knew early on that finding labeled data for what was an “at risk area” was going to be hard. Not only is the process of annotating every pixel over the US at any resolution difficult, but what constitutes fire danger is nuanced and complicated, and we are not well versed enough in the subject to make that judgement ourselves. Finding the WHP map solves this issue for us, but from an ML perspective, it has its problems. The biggest of which is that it is generated once every few years and does not correspond to any particular point in time. If we generate a new map every week, or even every month, we are really stretching the intended use of the WHP map.</p><p>Essentially, we are performing temporal interpolation by assuming that the WHP map corresponds best to observation of the US at the peak of fire season, in summer months, and hoping that the model will learn enough about geographically<em> different locations</em> to apply those nuances to <em>different times</em>. In other words, we want it to learn temporal differences <em>from</em> spatial differences. This will lead to somewhat of a domain gap at inference time if we try to predict fire hazard during different seasons. A <strong>domain gap</strong> in ML is when the data used for training are dissimilar from the data used at inference. While we know this will make the model imperfect, we still hope to see how it performs, and perhaps learn something for future attempts.</p><h4>A Neural Network for Semantic Segmentation</h4><p>The task of labeling every pixel in an image according to more than 2 classes is known as <strong>multi-class semantic segmentation</strong>. <a href="https://arxiv.org/pdf/1505.04597.pdf">The <strong>U-Net</strong> introduced by O. Ronneberger, P. Fischer, and T. Brox in 2015</a> is an excellent neural network model for this task [13]. While originally used for binary segmentation of cells in microscope images, it has been shown to generalize well to other segmentation tasks including multi-class segmentation of remote sensing data. The architecture is pictured below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*WPrjhB4rmJO2BoKtws7I5Q.png" /><figcaption>Architecture of the U-Net as presented in the original paper. Diagram by Ronneberger et al.</figcaption></figure><p>In this example, input images are 572x572. They pass through convolutional layers, increasing the number of channels. They are then contracted by a factor of 2 using a max pool operation, where they pass through another set of convolutional layers. This goes on 3 more times, after which the “images” or feature maps are then passed back up, using an up-convolution to invert the max pool operation. The images from the contracting path are appended to the corresponding images in the expanding path to help preserve the shapes and content of the original inputs.</p><p>Our implementation of the model using Tensorflow and Keras differs slightly to support the multiple input channels, the different image dimensions, and the multiple classes at the output. The full model can be initialized using a function, as shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4874c28a6c3c5cc9897bbd4a209cd032/href">https://medium.com/media/4874c28a6c3c5cc9897bbd4a209cd032/href</a></iframe><h4>Our Adjustments</h4><p>To support the sizes of our images, we had to make another important set of changes. Because the images have to be appended to one another, the dimensions in the contracting and expanding paths have to match exactly. For this to happen, the image dimensions must be cleanly divisible by 2 before each contraction. Our images were 513x565, clearly not divisible by 2, let alone 16. Using GDAL to read the geotiffs into a numpy array, we then pad the images to a dimension of 576x528, the next available multiples of 16.</p><p>We also implemented a weighted loss function to prevent the model from completely ignoring the less common classes like Very High Risk or Water. It does so by increasing the cost of a misclassifications inversely proportional to a class’s prevalence. The class distribution is shown below, note how the padding has added empty pixels covering about 12.6% of the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*HCVhmw5pE6mnSUJviXouEA.png" /><figcaption>Pixel-wise distribution of the classes in the padded and labeled images. Image by author.</figcaption></figure><p>With those important adjustments, we were able to train our model using 80% of our dataset, keeping the remaining 20% for validation and testing. We chose a batch size of 16, as our GPU didn’t have enough memory for 32. Our model converged after 20 epochs with an accuracy of 65% for both training and validation data.</p><h4>Visualizing the Output</h4><p>To observe the outputs of our model, we had to convert them back into geotiffs with appropriate coordinates. To do this, we save the metadata of the target images for each tile, and use it to export the array at the output of the neural network. We can then use <a href="https://qgis.org/en/site/">GQIS </a>to reassemble the tiles and display them on a map along with some additional elements like country and state borders, as well as a legend [14]. Using this method along with our model, we can now finally recreate the WHP map for years during which it was not made available!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*I5Rl62fKbIArA1Kfh44dFw.png" /><figcaption>Predicted Wildfire Hazard Potential map for July of 2019. Image by author.</figcaption></figure><p>From observing a few outputs during the summer months, we notice that our model is quite shy at predicting the highest level of risk. Comparing this map to original WHP maps, we notice a lot of red missing, particularly from the westernmost part of the United States. However, the model promisingly considers most of these regions with <em>High Risk</em>. Similarly, the model often ignores the <em>Low Risk</em> category, opting for <em>Very Low Risk </em>instead. These issues could possibly be solved by adjusting the loss function to further punish misclassifications of these underrepresented classes.</p><p>The model had little to no trouble identifying water as well as the non-burnable areas, including cultivated land in the Midwest and along the Mississippi River.</p><p>So the model performs reasonably well when presented with images from summers for which it wasn’t trained, but what would happen if we tried to predict wildfire hazard in winter months. To test this, we ran the predictions for January of 2020. Here are the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*1W0HIdDmcbFNzEfvNok4Xg.png" /><figcaption>Predicted Wildfire Hazard Potential map for January of 2019. Image by author.</figcaption></figure><p>Excellent! This shows that the model doesn’t just memorize and recreate the WHP map. There is evidence that suggests the model learned to generalize to months outside of its training domain. For example, the parts of the country that were covered in snow now appear as non-burnable, which makes sense since perennial ice and snow (which are very uncommon in the training data) were considered non-burnable in the original WHP map. Another nice result is that many <em>High Risk </em>and <em>Very High Risk</em> areas in the west have been downgraded, to <em>Moderate Risk</em> or even lower.</p><p>While the model does show evidence of learning to generalize temporal differences from geographic ones, there are still some clear problems. For example much of the south is now considered at higher risk than it was in the summer. Some research does suggest that states like Georgia and the Carolinas are more likely to experience fires in late winter or spring than states like California, but it still seems the model is over estimating the risk. Since the south does not experience much snow, the leafless trees and dry winter conditions (not seen during training) could be causing this.</p><p>Another couple of problems that are only apparent in the winter predictions are the noisier outputs and grid-like artifacts. In the non-burnable areas throughout the northern-most parts of the country, there appears to be some speckles of unnaturally high predictions, including a lot of single pixels of <em>Very High Risk</em>. The grid-like artifacts, most apparent around Oklahoma, Missouri, and Arkansas, seem to be caused by the tiling, though they don’t show up in summer predictions so there may be a way to correct them.</p><h3>iii) What did we learn?</h3><p>Given the daunting nature of this project, and that we only had a few short weeks to complete it, we were thrilled with the results. Learning to work with geospatial data was eye-opening, and using it to prepare a labeled machine learning dataset was anything but trivial. Working on this project has taught us a tremendous amount about both working with geospatial raster data and preprocessing data for ML.</p><p>At the time we started this project, no one to our knowledge had published models for automatically predicting wildfire risk at the scale of the entire country. While this model is far from perfect, it serves as a proof of concept. It demonstrates the possibilities for using geospatial data through APIs like GEE in deep neural networks to perform tasks on scales as large as the contiguous United States.</p><p>Geospatial data are plentiful, easy to access, and provide the perfect framework for data-hungry deep learning models. I highly encourage everyone to explore the possibilities! However, obtaining good labels can be quite difficult. Quantifying fire risk or danger remains the biggest problems with this particular tasks. The WHP map was a great starting point for this project, but with some expert help or even some manual labelling, the results would improve significantly. I look forward to revisiting this project when time permits.</p><p>I hope you enjoyed this read! If you have any questions about this project and the many implementation details I glossed over, please reach out either by leaving a comment or contacting me directly at <em>thjaquenoud@gmail.com. </em>I’d like to thank my collaborators on this project Kevin Kerliu and Brandon Bunt, as well as our professor Krishna Karra who showed us the ropes for raster data, geographic information systems, and tools like GDAL, GQIS, and GEE.</p><h4>Sources:</h4><p>[1] <a href="https://www.nifc.gov/fire-information/statistics">National Statistics</a> (2021), National Interagency Fire Center<br>[2] T. Feo and S. Evans, <a href="https://ccst.us/reports/the-costs-of-wildfire-in-california/">The Costs of Wildfire in California</a> (2020), California Council on Science &amp; Technology<br>[3] A. Beam, <a href="https://apnews.com/article/business-health-fires-climate-california-eec48e6279099449851b3c7f150cda33">California OKs new spending on drought, wildfire prevention</a> (2021), Associated Press News<br>[4] ORNL DAAC, <a href="https://daac.ornl.gov/cgi-bin/dsviewer.pl?ds_id=1379">MODIS and VIIRS Land Products Global Subsetting and Visualization Tool</a> (2018), NASA EOSDIS Land Processes DAAC<br>[5] S.C. Goslee, <a href="https://landsat.gsfc.nasa.gov/">Analyzing Remote Sensing Data in R: The LANDSAT Package</a> (2011), Journal of Statistical Software<br>[6] N. Gorelick, M. Hancher, M. Dixon, S. Ilyushchenko, D. Thau, and R. Moore, <a href="https://earthengine.google.com/">Google Earth Engine: Planetary-scale geospatial analysis for everyone</a>, Remote Sensing of Environment<br>[7] GDAL/OGR contributors, <a href="https://gdal.org/">GDAL/OGR Geospatial Data Abstraction software Library</a> (2022), Open Source Geospatial Foundation<br>[8] R. Simmon, <a href="https://medium.com/planet-stories/a-gentle-introduction-to-gdal-part-1-a3253eb96082">A Gentle Introduction to GDAL</a> (2017), Planet Stories<br>[9] J.T. Abatzoglou, <a href="http://onlinelibrary.wiley.com/doi/10.1002/joc.3413/full">Development of gridded surface meteorological data for ecological applications and modelling</a> (2013), The International Journal of Climatology<br>[10] LANDFIRE,<a href="https://landfire.gov/index.php"> LANDFIRE: Existing Vegetation Type</a> (2020), U.S. Department of Agriculture and U.S. Department of the Interior<br>[11] USDA National Agricultural Statistics Service, <a href="https://data.nal.usda.gov/dataset/cropscape-cropland-data-layer">Cropland Data Layer</a> (2020)<br>[12] G.K. Dillon, J. Menakis, and F. Fay, <a href="http://www.treesearch.fs.fed.us/pubs/49429">Wildland Fire Potential: A Tool for Assessing Wildfire Risk and Fuels Management Needs</a> (2015), U.S. Department of Agriculture, Forest Service<br>[13] O. Ronneberger, P. Fischer, and T. Brox, <a href="https://arxiv.org/pdf/1505.04597.pdf">U-Net: Convolutional Networks for Biomedical Image Segmentation</a> (2015), The Computing Research Repository<br>[14] GQIS.org, <a href="https://qgis.org/en/site/index.html">QGIS Geographic Information System</a> (2022), QGIS Association</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c6b1d415eb4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/ai-geospatial-wildfire-risk-prediction-8c6b1d415eb4">AI Geospatial Wildfire Risk Prediction</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MusicAE: A Musician Friendly Machine Learning Tool]]></title>
            <link>https://medium.com/data-science/musicae-a-musician-friendly-machine-learning-tool-7e7ccc3726df?source=rss-6eecc6432467------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e7ccc3726df</guid>
            <category><![CDATA[music]]></category>
            <category><![CDATA[synthesizers]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Theo Jaquenoud]]></dc:creator>
            <pubDate>Tue, 23 Mar 2021 04:29:08 GMT</pubDate>
            <atom:updated>2021-04-07T21:06:51.190Z</atom:updated>
            <content:encoded><![CDATA[<h4>An overview and example of how to make machine learning tools accessible to musicians in the digital age</h4><p>Written by Theo Jaquenoud, Samuel Maltz, and Zachary Friedman</p><h3>What musical ML tools currently exist?</h3><p>Over the last few years, a number of tools have been published to introduce machine learning (ML) to the world of music. Most notably, Google has published dozens of fun apps and prototypes using Magenta, “an open source research project exploring the role of machine learning as a tool in the creative process.” Of the myriad of ML tools available, some work to enhance artists’ work, but many seek instead to replace the artist entirely.</p><p><a href="https://experiments.withgoogle.com/ai/ai-duet/view/">Ai-Duet</a> lets you play a virtual piano, and automatically performs a duet along with you. <a href="https://www.google.com/doodles/celebrating-johann-sebastian-bach">Celebrating Johann Sebastian Bach </a>was a Google Doodle (apps and animations that replace the Google title on the search page) which allows you to compose a single melody, and it generates a four-part counterpoint in the style of Bach, while admittedly breaking some of Bach’s fundamental rules of which he wrote extensively. On a sillier note, <a href="https://artsandculture.google.com/experiment/blob-opera/AAHWrq360NcGbw?hl=en">Blob Opera</a> lets you control a group of blob shaped opera singers, inputting the pitch and vowel in real time. While such programs can be extraordinarily complex, and are fun to use, their use cases are more-or-less relegated to novelty; no serious artist would produce music through a singing blob or imitative piano program. However, another breed of music ML is rising alongside this one, one that expands the tools available to an artist, rather than replacing them entirely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n2zBp90ydXY5fSh0CdOXpA.jpeg" /><figcaption>Blob opera singers are astonished by their soprano&#39;s coloratura performance | <a href="https://artsandculture.google.com/experiment/blob-opera/AAHWrq360NcGbw">by Google Arts and Culture</a></figcaption></figure><p>Two of the most popular such tools are <a href="https://sites.research.google/tonetransfer">Tone Transfer</a> and <a href="https://nsynthsuper.withgoogle.com/">NSynth</a>. Tone Transfer allows musicians to upload short samples played on any instrument (or non-instrument), and it outputs a reinterpretation of the sample performed on one of four instruments: flute, saxophone, trumpet, or violin. It captures the pitch and inflections of the original piece surprisingly well, but where it fails is in the interface. The tool is only available online as a web app, and it clunkily requires artists to upload and download their short samples one at a time, with no easy connection to common programs such as digital audio workstations (DAWs). NSynth on the other hand present extensive open-source documentation on how to build the physical instrument, with standard interfaces like Musical Instrument Digital Interface (MIDI) or USB. The problem with NSynth is that, even if you can assemble it, it only works as a stand alone instrument, and can’t be implemented as software for the synthesizers or MIDI controllers that most musicians already own.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7dJqo32T5dMpCFweiWWa5A.jpeg" /><figcaption>An example of an assembled NSynth built on top of a Raspberry Pi with MIDI interface | <a href="https://nsynthsuper.withgoogle.com/">by NSynth Super</a></figcaption></figure><p>So what would constitute an ideal tool for musicians to gain access to machine learning? In many of the examples we’ve shown above, the AI is replacing, or attempting to replace, the musician. In some cases, it tries to imitate a composer, in other cases a performer, but it tends to fall short. We think ML techniques can be most successful when they are used to enhance the artist’s creative experience. <strong>Additionally, the tool must be accessible, intuitive to use, and fit into a musician’s workflow. </strong>The best way to guarantee this last point is to build the tool on top of platforms that musicians are already familiar with, and in this digital age, the gold standard is the digital audio workstation. If the machine learning methods can be implemented as a plug-in in a standard format like virtual studio technology (VST), musicians will be able to integrate it seamlessly into their normal workflow.</p><h3>Introducing MusicAE</h3><h4>Mission statement</h4><blockquote><strong>MusicAE </strong>uses advanced machine learning techniques to create a unique representation of those elements of sound that are difficult to quantify, and provides a simple interface to creatively interact with them.</blockquote><h4>How does it work?</h4><p>MusicAE is neural network powered synthesizer and effects tool that uses an autoencoder architecture to learn the “fingerprints” of certain sounds and smoothly interpolate between them. Autoencoders work by using raw data, such as audio signals, as inputs. They learn to encode or compress the data using less information, a process called <strong>dimensionality reduction</strong>,<strong> </strong>and then symmetrically recomposes the data into its original form. In the center of the decoder, the entirety of the data is represented in as few numbers as possible. This is known as the <strong>latent space</strong>,<strong> </strong>and represents the distilled essence of the input data, the “fingerprint.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QEmCZtruuWwtEOUzew2D4A.png" /><figcaption>Graphical representation of an autoencoder neural network architecture | by <a href="https://www.compthree.com/blog/autoencoder/">Steven Flores</a></figcaption></figure><p>We train our autoencoder using a corpus containing tones generated by a variety of synthesizers, organs, and other keyboard instruments. Over several epochs of training, the autoencoder learns how to efficiently compress sounds into a lower dimensional latent space, and then decode it back into a nearly identical sound. Where this neural network becomes creative is when you bypass the encoder and simply introduce a vector of numbers into the latent space. The network will decode the latent vector as if it had been encoded from sound, and will output a short audio sample, unique from any of the sounds it was trained on. This is where the musical tool comes in. We envision three potential uses for MusicAE:</p><ul><li><strong>Synthesizer:</strong> This is like the example described above. There is no musical input to the autoencoder, the user simply defines a latent vector, either on a GUI or using a MIDI controller, and the decoder network creates a sound. Smooth changes to the latent space correspond to smooth changes in the output, providing musicians with a brand new way of synthesizing unique sounds.</li><li><strong>Effects:</strong> In effects mode, the autoencoder uses an audio stream as an input, and the decoder is able to reconstruct it. By introducing small changes to the latent space, the sound is transformed in various subtle ways, much like if passed through distortion, equalizers, or other effects.</li><li><strong>Mixer: </strong>In this mode, two parallel networks simultaneously encode two audio streams. Then, much like a fader could allow you to transition smoothly between tracks, the two latent spaces are mixed together, and decoded as one. Users can not only choose how much of each track to include in the mix, but can also control the mixing for each dimension in the latent space, resulting in creative mixes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uT7qtkOACTVIZLKkgCkzsg.png" /><figcaption>Summary of the three operations provided by MusicAE | by authors</figcaption></figure><p>Unlike a traditional synthesizer which has dedicated controls for features like pitch, waveform, attack, decay, center frequency, harmonics, <em>et cetera</em>, the autoencoder learns these characteristics of sounds and abstracts them into a latent space in a way that amorphously combines them all. In the three uses described above, the artist gets to discover a new dimension, or several, to the sounds and tools they are used to working with. Being able not only to fade between two sounds, but to intricately mix them based on their latent representations, is an entirely unique experience that no other tool currently provides.</p><h4>Demonstration</h4><p>An example of the mixing and synthesizer modes are shown below using a prototype graphical user interface (GUI). For the mixing, the horizontal slider controls how much of each track to combine into the latent space for decoding, whereas the ten vertical sliders combine the track’s individual latent dimensions. In this prototype GUI, the autoencoder models are pre-trained and can be loaded in via a file name, as can the input audio files in the case of mixing and effects. In the demo video, one input sound is a pulsating synth bass, and the other is an organ. Notice how the different qualities of each sound, such as the pulsations of the bass, combine as different latent dimensions are changed. In the case of the synthesizer, each slider determines the value of one of the dimensions in the latent space, and we hear the decoded output.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FX49sRJ29SG8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DX49sRJ29SG8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FX49sRJ29SG8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bce37fc340281350d949790bd066a1c6/href">https://medium.com/media/bce37fc340281350d949790bd066a1c6/href</a></iframe><h3>Working towards a plug-in</h3><p>As we discussed in the first section, the quality of a musical tool, and how much use it can be to a musician, is directly related to how well it fits into their workflow. Of the few AI musical programs out there that are intended for use by musicians, none have adequately considered the environments within which they engage with their creative process. Today, virtually all music is processed with a DAW, whether the recording itself is digital, or simply being mastered. If you want musicians to use your ML tool, you must make it work with DAWs!</p><p>The most common way to create programs that can work within a DAW is using plug-ins and widely supported platforms like VST. They allow musicians and programmers to create their own GUIs which can interact directly with music loaded into a DAW, and can create effects, MIDI controls, or even entire virtual instruments. Platforms like VST are widely supported, and compatible with most DAWs. For MusicAE, we would like the plug-in to be able to read and write the audio directly to and from the DAW. Ideally, these operations should be as simple as highlighting tracks to select inputs and defining a blank track as an output, or loading in our synthesizer as a software instrument. The sliders controlling the latent space can be controlled directly on the screen, or mapped to analog knobs and sliders on a MIDI controller that is connected through the DAW.</p><p>While our original code was designed using python, which gave us easy access to the most widely used machine learning and neural network libraries, notably TensorFlow, VSTs and software instruments are almost universally written using the C++ programming language. Being able to port the trained autoencoder model into a different language, and learning to work within the constraints of VSTs has proven to be a challenge, but we have been able to replicate the functionality of our prototype GUI, and are now looking towards more intuitive interface to work seamlessly within any DAW. A mockup based on our existing GUI is shown below alongside the popular Mac OS app GarageBand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gnVq8WAdgfa1MVgpId9BIQ.png" /><figcaption>Mock-up of MusicAE integrated as a plug-in for Mac OS based DAW | by authors</figcaption></figure><h4>Conclusion</h4><p>While there is much exciting work happening at the intersection of machine learning and music, few developers have seriously taken into consideration the needs of digital musicians. Our goal with MusicAE is not just to build a tool that presents musicians with a completely novel way of interacting with music, but also to help them integrate it into their workflow using methods they are familiar with. So far, we have experimented with different neural network architectures and found suitable models which we have tested in standalone GUIs. We now set our sights on fully incorporating this functionality into a VST plug-in to make our tool compatible with a majority of DAWs, thereby making it accessible to musicians.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*jXyS2sU2mwAa8BXx5o1rCg.jpeg" /></figure><p>This project was completed by Theo Jaquenoud, Samuel Maltz, and Zachary Friedman as part of a senior electrical engineering design project at The Cooper Union. We would like to thank our advisor <a href="http://ee.cooper.edu/~keene/">Professor Samuel Keene</a> for introducing us to this project, as well as <a href="https://www.josephtcolonel.com/">Joseph Colonel</a>, a Cooper Union alumnus and current PhD candidate in the Centre for Digital Music at Queen Mary University of London. He first conceived of this idea and provided much of the foundation on which we built our software.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e7ccc3726df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/musicae-a-musician-friendly-machine-learning-tool-7e7ccc3726df">MusicAE: A Musician Friendly Machine Learning Tool</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>