About

Is the mountain out? People around Seattle have been asking this question for decades. On a clear day Mount Rainier, or "Tahoma" as local Indigenous peoples called it, appears to towers over everything around it, even from dozens of miles away in Seattle. It's the most prominent peak in the contiguous United States, but it unfortunately spends a lot of the year hidden behind Seattle's (in)famous cloudy weather.

This project was started during the Big Dark, the grey stretch of the year when the mountain can stay tucked away for weeks at a time and you half forget it's out there. It was a way to learn some new skills, like web development and machine learning, and a fun excuse to try answering that question a new way: by automatically detecting when the mountain is out.

Tahoma Tracker is what came of that. It uses a dedicated camera pointed at the mountain, a model that analyzes every photo it takes, and a page that answers the question. You can also sign up to be notified when the mountain is out.

How it started

The Space Needle's panocam helped get this project off the ground without months of setting up hardware and collecting images first.

There's a camera on top of the Needle that publishes a panorama of the city about every ten minutes, and if you crop the right piece, you get Mount Rainier (on the good days that is). I used AWS to fetch each new panorama, crop it, and run it through a classifier I trained on a few thousand images that were manually labeled.

The panocam is a great resource I still use, but it has some limitations. It's not meant to take images specifically of the Mount Rainier, so sometimes it doesn't come through in the images even when it is visible to the naked eye. The camera is also stitching together images from a rotating camera, so the stitching can frequently misalign for getting a specific crop. The camera can go also down for maintenance or other reasons.

I could correct the drift in software, and that turned into its own project. But I couldn't make the mountain any clearer. So I decided to take my own pictures.

The Tahoma Tracker Cam

The camera in its weatherproof housing on a balcony rail at sunset, with Mount Rainier lit pink on the horizon beyond the neighborhood
The Tahoma Tracker Cam, with the mountain catching the last of the light.

The Tahoma Tracker Cam serves as a dedicated camera for capturing images of Mount Rainier. It is a Canon Rebel T6 with a 55-250mm lens (thanks to Glazer's for the help!), sealed in a weatherproof housing on a balcony with a clear line of sight to the mountain. A Raspberry Pi 4 sits next to it and fires the shutter every five minutes.

A breadboard of jumper wires and components held in one hand, wired to a Raspberry Pi in a black case
The trigger circuit: an unexpected venture into breadboarding.

I had never really used a DSLR camera before this, and getting one to take pictures over long stretches turned out to be the trickiest part of the build. The original approach was to trigger it over USB, but that software is buggy for this particular setup. It has a habit of wedging the camera in a state that requires physically fixing it (good ol' turn it off and on), which defeats the point of an unattended camera. So a setup I already thought was hardware-heavy got more so, and I ended up building a remote shutter to improve reliability.

A small circuit on a breadboard connects two of the Pi's GPIO pins to the camera's remote port, so the Pi can close the shutter switch exactly the way a wired remote does. Taking the picture no longer depends on the USB path at all, which is the part that used to wedge the camera into the dreaded "PTP Device Busy" state it couldn't recover from on its own. The camera unfortunately still would get wedged sometimes, so I added a smart plug that the Pi power cycles every night and if it gets wedged, which has made the whole setup much more reliable.

From there the Pi pulls the new frame over USB, crops and resizes and watermarks it, runs the visibility model on the Pi itself, and uploads the photo and the result to an S3 bucket backed by CloudFront, the same as the original Space Needle setup.

Scoring visibility

Every photo gets sorted into one of three buckets:

Out Partially Out Not Out

Partially Out covers the in-between moments where the mountain may be pretty hazy or partially covered by clouds.

Creating the classification model started off with labeling thousands of photos manually. To speed that up, I built a page for rapid labeling and for filtering back through the labels to clean up the bad ones. Those labels went into training a ResNet-50 model that now does the labeling automatically. The model still gets things wrong, and when it does there's a correction link under the image on the homepage. Those go straight into the pile of labels for the next round of training, so I encourage you to submit corrections to help guide the next model if it's getting them wrong!

The Tahometer Score

Every day gets a number from 0 to 100 to rate the visibility of the mountain.

Tahometer Score

( fully-out photos + ½ × partially-out photos ) ÷ all daylight photos × 100

Only photos between sunrise and sunset count. A 100 means every image that day was marked "out," while a 0 means it never showed. Pro tip: the calendar colors each day on a gradient based on its Tahometer Score, so you can see at a glance which days were the good ones.

Under the hood

The two pipelines

Tahoma Tracker Cam
Camera
every 5 min
Raspberry Pi
trigger + classify
S3 / CloudFront
store + serve
This site
published every 10
Space Needle Panocam
Public webcam
every 10 min
AWS Lambda
align, crop, classify
S3 / CloudFront
store + serve
This site
you're here!

The shapes are similar between the Tahoma Tracker Cam and Space Needle Panocam. The Tahoma Tracker Cam does everything locally and uploads a finished result. The Space Needle path does all of it in a Lambda, since there's no hardware I control on that end, just a public image URL to poll.

Why the Space Needle needs a second model

1

Frame State Space Needle only

Is this image even usable? The panorama crop can be aimed the wrong way, stitched badly, blurred, or simply dark. This model catches those first, so the visibility model never sees them.

Good Off-Target Dark Bad
2

Visibility

If the frame is good, can you see the mountain?

Out Partially Out Not Out

The Tahoma Tracker Cam skips stage one. It doesn't move and it isn't stitching anything together, so off-target and badly-assembled frames aren't categories that exist for it, and "too dark to tell" folds neatly into Not Out.

The alignment problem

The Space Needle webcam is bolted to the top of the Space Needle, but the panorama it produces isn't always aimed the same way, and it can be off by a lot. The orange box in these two images shows where the model's mountain crop lands.

Panorama with crop box highlighting downtown Seattle buildings, camera has drifted away from Mount Rainier
Before Alignment
Same panorama after alignment with crop box correctly centered on Mount Rainier
After Alignment

In the first one, Rainier is nowhere near the box.

There was a second, subtler version of this problem. Early on I trained the visibility model on the wide display crop rather than a tight crop of the mountain, which meant it was learning from the sky and the cityscape as much as from Rainier itself. The current version registers each panorama against a reference image, corrects the drift, and only then cuts out the mountain.

Fixing it paid off more than I expected. Of roughly 9,400 images the old model had thrown out as "Off-Target," alignment recovered over 80%. Nearly 1,800 turned out to have the mountain plainly visible.

FAQ

The image isn't updating. Is the tracker broken?

The Space Needle webcam often publishes every 20 minutes instead of every 10, and it goes offline now and then for maintenance; the tracker can only work with what shows up. On the Tahoma Cam side, a long gap usually means the Pi or the camera hit a snag, most often a stuck USB connection. Either way it picks itself back up as soon as new photos start arriving.

Can I use these photos?

Photos from the Tahoma Tracker Cam are free to share and post. If you want to use one commercially, or you're after something bigger than what the site serves, email me first and we'll sort it out. What I'd rather you didn't do is scrape the archive wholesale to stand up a copy of this project somewhere else. Images from the Space Needle Panocam aren't mine to license; those need to be credited to the Space Needle. Questions either way: contact [at] tahomatracker.com.

About me

I'm Jacob Knight, a software engineer in Seattle (if that wasn't already clear). I work on distributed systems, which is a long way from cameras and frontend, and this started as a way to learn the parts I don't touch at work. You can find me on LinkedIn.