Resurrect an ancient pagan weather god with TensorFlow in 10 easy steps

Published on 2024-07-17


Content warning: climate change.

So I'm listening for the weather
To predict the coming day
Leave all thought of expectation
To the weather man
No it doesn't really matter
What it is he has to say
'Cause tomorrows keep on blowing in
From somewhere...

"Listening for the Weather" by Bic Runga (yewtu.be)

In 2021, the Cascadian bioregion (mainly Oregon, Washington, British Columbia, and Yukon) was hit with a historic heat dome leading to dangerously high temperatures across the region. On the 29th of June, the ~250 residents of Lytton, BC as well as the thousands of First Nations people living in the surrounding area witnessed temperatures of 49.6 °C—the highest-ever recorded temperature in Canada. The next day, Lytton was eviscerated by a wildfire.

2021 Western North America heat wave (en.wikipedia.org)

Lytton wildfire (en.wikipedia.org)

2021 was the year I moved to Cascadia for university, arriving in September. My newfound friends had documented their journeys in videos I got to see—videos of them driving down narrow roads, around toppled trees, surrounded on both sides by raging fires. It was dry and hotter than I'd expected—hotter than I was used to. I overpacked and overdressed, and I paid the price until the relief of winter finally came three months later.

It's been hot this last week, and it'll be hot for at least another week until our most optimistic weather models suggest the coming of a warm rain to dampen the soils we've made barren through decades of ecological abuse. Today it was only 35, which was an unexpected relief. This weekend the weather prophets are calling for a high of 41. Last year, my town got burned too; all I can hope for now is that it didn't leave enough fuels to fuel fires this fire season coming.

Last year, I took a course in geology. Thinking about plate tectonics and deep time went a long way towards reframing how I think about the Earth, and how I think about the biotic/abiotic divide in particular. I stopped thinking of abiotic processes as dead things toiling under the influence of entropy. I started to notice the way they too were alive in the same sense as me, only that their life played out over a timescale I struggle to imagine.

Rocks are as animate as I am

I like to say that my relationship to the atmosphere is a lot like how Eastern Orthodox Christians relate to God. The bio-geosphere is something to be loved, but the atmosphere is something to be feared.

I first studied atmospheric science last semester, and I think that was my biggest takeaway. The atmosphere is a beautiful and terrifying agent of chaos. This summer, I've started work for a research team that works in meteorology, and so I've been thinking a lot about the weather. These days, I spend most of my waking hours thinking about it in one way or another. I feel its weight pressing on me every time I apply another layer of sunscreen and walk down the dark, asphalt stroad from my home to the bus stop.

Last week, I had the opportunity to attend a panel between experts from around the world to discuss progress in the field of machine learning and its applications to weather forecasting. As someone who's generally very skeptical about the current wave of artificial intelligence projects, I felt at first a little disinterested, but I was pleasantly surprised, and honestly a little shocked at how it went. It really laid bare a conflict in the church of modern weather forecasting that most laypeople like myself don't really get access to as we look up the weather forecast on Weather.com.

The panel quickly split along party lines I didn't even realize existed: one I'd call the "machine learning engineers" and the numerical weather forecasters. Numerical weather prediction uses physical models, which I'm going to probably incorrectly describe as "a bundle of physics equations" that deterministically take a set of inputs and output a predicted future state of the atmosphere. Characteristically, these numerical models can be understood by a single person, albeit with a lot of specialized training. At this point, it's kind of cliche for me to describe Western science as a religion, but I hope the comparison isn't lost when I describe our weather druids as a highly trained specialists and carriers of the knowledge to predict the future of the sky.

The machine learning engineers see a different future in meteorology. They see advances in machine learning, yielding new algorithms that can recognize patterns in data so complex that no single human could ever truly understand them. They see meteorologists with petabytes of structured data describing the state of the atmosphere every hour. They see an opportunity to push our forecasts to the limits of what we can reliably measure.

Over the last century, we've seen an explosion of computation, enabling a global civilization that is largely possible thanks to the proliferation of disproportionately powerful computers. Meanwhile, all the history of meteorology has cumulated in forecasts that are reliable to at best two weeks in the future, and that's using more computation than any normal person could begin to imagine. That's not to say meteorologists aren't smart; I'm routinely blown away and honestly a little terrified of how smart the people I meet at work are—people who've made it their lives' work to understand the atmosphere in as much as that's even possible. It's just to say that "understanding the atmosphere" means something fundamentally different than, say, understanding the Linux kernel. However complex the Linux kernel may be, it can be fully described in a finite number of instructions—you could download them right now for free if you really wanted. Whether or not something like the atmosphere could be fully described is an open philosophical question in physics; I'm sure most meteorologists would settle for a reliable one-month forecast.

It's for problems like these that we've bothered developing deep learning algorithms—problems so complex that they can't be comprehensively described except through a bundle of related observations. Computers may be able to forecast the weather better than humans, and with that comes a lot of complicated epistemological questions. The numerical weather forecasters are rightfully scared, because while the technology is currently in use and shows a lot of promise, it's not proven like the numerical models are. What it means for something like a deep learning model to be "proven" is in and of itself an open epistemological question; the best we can do is measure its accuracy with statistics and pray the inscrutable relationships it describes are grounded in a reality we understand, lest they make disastrous mistakes that are themselves hard to foresee. Whereas the numerical weather forecasters look up in search of truth, the machine learning engineers seek to bring that truth down to the surface.

And like everyone in the machine learning space today, they are very confident in their ability to do so. Dangerously so.

I'm not going to pretend that we don't know how climate change is going to impact the Earth. We do know; we know that it's going to make things a lot worse. But what specifically is going to happen if the global average temperature hits, say 2°C, is a lot harder to predict. The atmosphere has always been chaotic but for the longest time, on a global scale, it at least exhibited some regular patterns. We don't have any recorded history of such an abrupt change in the global conditions of the atmosphere. So while we can expect things like more wildfires, flooding, hurricanes and warmer temperatures near the poles, it's a lot harder to be more specific than that. Models are growing out-dated; the climate is changing faster than we can accurately model its behaviour. If you're ever wondering why it seems to be consistently warmer than Weather.com tells you it'll be, that's probably why.

So, maybe the weather god resurrectionists are right. Maybe their promise offers a narrow path through climate chaos. Maybe we should divest from numerical models and go all in on a deep learning future. But the more we embrace deep learning algorithms, the more inscrutable meteorology becomes. Not only does it represent a transfer of power away from the weather druids, but a transition from a world where the atmospheric future is guarded by those who've dedicated their lives to understanding it to one of a machine that knows all and tells none.

The thing is, machine learning models work. They're working right now; the forecast you're seeing when you search "weather forecast 7 day seattle" online is, in all likelihood, generated by a machine learning model. Specifically, it's probably a statistical best-estimate based on a combination of forecasts from a number of different models, including both physical and deep learning models. Atmospheric science is a science, but at the end of the day, it's an eminently applied science, with very material impacts on regular people. Atmospheric science is a science with a kill count. During the 2021 heat dome, that kill count was at least 1400.

For what it's worth, meteorology is hardly the only discipline running up against this problem. In fact, my example about the Linux kernel might have even been a little deceptive. Can anyone honestly say that they "completely" understand the Linux kernel? If they did, what would that even mean? If someone truly, honest to goodness did understand the Linux kernel, could they ever understand, say, Debian? It's package repository? The network of social relationships that bring the software together on a regular release schedule? The Canadian Constitution, the Canadian Charter of Rights and Freedoms, every law ever passed by Canadian parliament and every court case may be dutifully documented in writing somewhere and yet I'm sure that if you read every word of it you'd still struggle to understand the relationship I personally have with my internet service provider.

I suspect that even for systems that can be described in a finite number of instructions, there's still a hard limit on what any human could ever understand. I don't know what that limit is. I don't think it's even possible to prove what that limit is, but I do think the Chrome browser is well beyond it.

Whether or not I know what to do with it, I think my biggest takeaway from the panel was that in 2021, machine learning models foresaw the heat dome where numerical models didn't. At the time, meteorologists wrote it off as a fluke, thinking such temperatures were unrealistic for the region. That knowledge is something that I'm going to have to carry with me for quite some time.

Respond to this article

If you have thoughts you'd like to share, send me an email!

See here for ways to reach out