DEV Community

ATLAS
ATLAS

Posted on • Originally published at geoguessrcheats.com

I built an AI that plays GeoGuessr. Here is how single-image geolocation actually works.

Give a person a single street-view photo with no metadata and ask them which country it is. A trained GeoGuessr player will often get it in a few seconds. They are not reading a hidden GPS tag. They are reading the image: the color of the road lines, the shape of the bollards, the script on a distant sign, the vegetation, the direction of the sun, the style of the power poles.

I spent a long time building a system that does the same thing from one frame, and the interesting part is how ordinary the core idea turns out to be. Here is what actually matters, and what does not.

The problem, stated honestly

Single-image geolocation is: given one photo, output a location. In practice you want two things at once, and they are not the same task.

  • Coarse: which country or region is this. This is a classification problem over a few hundred buckets.
  • Fine: the exact latitude and longitude. This is a regression problem over a continuous surface.

People conflate them, but they behave very differently. Country is often readable from a handful of strong cues. Pinning a spot to within a few kilometers usually needs the model to recognize something specific: a particular road surface, a chain of shops, a mountain profile. A model can be excellent at the first and mediocre at the second, and most of the disappointment in this space comes from expecting one number to capture both.

The cues, and why they are learnable

The signal is real and it is visual. A short, non-exhaustive list of what carries country-level information:

  • Road markings. Line color, dash length, and edge treatment vary by country in ways that are remarkably consistent.
  • Signs and language. Even blurred, the script and the sign shapes narrow things fast.
  • Driving side and the position of the camera car.
  • Bollards, guardrails, utility poles. These are almost a fingerprint. Enthusiast communities have catalogued them for years.
  • Vegetation, soil color, and light. Latitude and climate leak through the plants and the quality of the sun.
  • Architecture and street furniture. Rooflines, fences, and even the design of a bus stop.

None of this requires a human to hand-label. If you show a model enough geotagged street-level images, it discovers these regularities on its own. That is the whole trick, and it is why the field moved from clever hand-built features to "collect a lot of images with known coordinates and let the model find the pattern."

Two ways to frame the model

The naive framing is to regress coordinates directly: the network outputs a lat and a lng, and you penalize distance. It sounds right and it works badly. Averaging is the enemy. If a scene is ambiguous between, say, two plausible countries, a regressor splits the difference and drops your pin in the ocean between them.

The framing that works better is to turn the map into a set of cells and classify. You divide the world into regions, ask the model which region the photo belongs to, and then refine within the winning region. Classification lets the model keep multiple hypotheses alive and commit to the most likely one instead of averaging incompatible guesses. The size of the cells is a genuine knob: too coarse and your best case is a country, too fine and each cell has too few training images to learn from.

A useful mental model: the network is a very good "this looks like here" matcher, and the map structure is what stops it from saying "somewhere in the middle of everywhere."

Data is the lever, not the architecture

The uncomfortable lesson is that the backbone you pick matters less than the data you feed it. Coverage is everything. If a country is underrepresented in training, the model is bad there, full stop, and no loss-function cleverness rescues it. Getting broad, balanced, geotagged street-level imagery across as many countries as possible did more for accuracy than any change to the model itself.

Two practical consequences:

  • Class imbalance is brutal. A handful of heavily photographed countries will dominate and the model will happily overpredict them. You have to correct for it explicitly.
  • Leakage will lie to you. If near-duplicate images end up in both training and evaluation, your benchmark looks great and real games do not. Deduplicate by location, not by file.

What it is honestly good and bad at

Country-level, on ordinary street views, this kind of system is strong. Exact coordinates are much harder and depend on the scene giving up something specific. Ambiguous or generic places (a plain road through farmland that could be one of ten countries) are where both humans and models struggle, and no tool should pretend otherwise.

I packaged all of this into a desktop app called ATLAS that reads a GeoGuessr street view and returns a country and a map pin in about three seconds. It is trained on millions of street-level images and gets the country right about four times out of five in real games, and I am upfront on the site about where it still misses. If you want to see it work or read more, it lives at geoguessrcheats.com.

Takeaways if you want to build one

  • Separate the coarse and fine problems in your head, and probably in your model.
  • Classify into map cells and refine. Do not regress raw coordinates.
  • Spend your effort on data coverage and balance before you touch the architecture.
  • Guard your evaluation against location leakage or you will fool yourself.

Single-image geolocation feels like magic the first time you watch it drop a pin on the right continent from a photo of an empty road. Under the hood it is mostly the same thing the good human players do, scaled up: notice the small, boring, consistent details, and refuse to average away your uncertainty.

Top comments (0)