Chris and Krishna talk about validation as a practical part of developing geospatial analytics, focussing on their personal experiences mapping oil palm and land cover at scale. A central theme in throughout this conversation is the use of auxiliary geospatial products, science and human intuition to validate maps. (00:00) Introduction, what is validation? (02:30) Chris talks about mapping oil palm using Sentinel-1 (25:00) Krishna talks about global land cover mapping using Sentinel-2 (51:00) What tools do Krishna and Chris use for validation. (Krishna loves QGIS) This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit christopherren.substack.com
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
SPEAKER_00What are we talking about today, Krishna?
SPEAKER_02I thought we were going to talk about validation. The last 20%, the piece of this puzzle that nobody is building solutions for, as far as I can see. Do you think nobody's building solutions? I don't know. How many people are focused on the last 20%? I feel like everybody's focused on getting to the demo, getting to the map, getting to the first 80%.
SPEAKER_00I could be wrong about that. So in terms of validation, it's like the step where you've deployed your model you're looking at the map and you're trying to determine if your map is any good. Is that what you mean?
SPEAKER_02Yeah. And whether, um, whether you feel like you need to run the model again, whether you feel like you need to add additional data, the process of like figuring out what other experiments you might need to run as a result of your output. Maybe we can roll all of that kind of into validation a little bit, if that makes sense.
SPEAKER_00Yeah, so pretty much like iterating on the first deployment.
SPEAKER_02Iterating on the first deployment. You did a bunch of work to figure out what data you should use, what technique you should apply, and you ran an output, and you have a map. You did it. You did it, and you have your map, and then you say, what's next?
SPEAKER_00Yeah.
SPEAKER_02Is this correct?
SPEAKER_00Yeah. yeah aka the slog the slog it's just it's just so fast until you get to that point and then i feel like it really breaks your momentum up you know before then and you're like sampling and like you're setting up the pipelines and you run it and it's just running and you parallelize it and then And then it's like you have to stop. You have to totally stop.
SPEAKER_02Totally stop. Yeah. And maybe the best way to talk about this is to actually talk through problems that we've done so that we can make this concrete rather than talking abstractions. Maybe we should start with you. For sure.
SPEAKER_00Yeah, yeah. I think the first map that really comes to mind where I had to do this... was the oil palm map at Grow Intelligence.
SPEAKER_02Could you set it up a little bit? Could you talk about what is oil palm? Why do people care about mapping it?
SPEAKER_00Yeah. Yeah. So oil palm is a... high volume commodity I guess a lot of people trade it it's used as cooking oil in a lot of countries but it's also used in a lot of products like a you know Unilever for example probably has a ton of products that use oil palm so lotion thank you Krishna
and and so with any commodity like this uh traders are interested in it and traders are usually interested in not just knowing um how much yield you know which is like a function of like the weather and things like that but they also want to know acreage because uh how much oil palm was planted in the year 2022 in indonesia
SPEAKER_00Yeah, not even necessarily planted, but was productive or harvested. Like a harvested area. Because once you know that, and if you know yield, then you know production, which is the actual quantity that most people care about, right? Like that's supply. And so at Grow Intelligence, you know, they were in the business of... yield modeling, production modeling as well, trying to sell data streams to commodity traders.
SPEAKER_00So this was actually my first project there. And thinking about it now, I think I made a number of rookie mistakes starting that project. The first one, which is related to validation, was not really thinking about how the map I was producing was going to be used. When I arrived, I kind of treated this like a sort of, this is like a demonstration of capability. Like- Make a cool map.
SPEAKER_00Make a cool map. They didn't really have the capability to deploy like, a machine learning model. Like they didn't have great crop detection models. Okay. When I arrived, I hope I'm not getting this wrong, but I'm pretty sure that in the U S I think they just used preexisting sort of like cultivated, cultivated CDL or something, something like that. Yeah. And so in my mind, I was kind of thinking this of this as like a demonstration of
capability.
SPEAKER_00Like, you know, we're gonna, I'm going to, I'm going to implement this and show people how to do it and that'll be good enough. Got a little chip on your shoulder. Exactly, exactly. Get a gold star. But I was actually very mistaken because people cared about acreage, which was basically, they didn't even really care about the map itself, they cared that when I summed all the pixels, the total area should add up to some number provided by the
Malaysian palm oil
SPEAKER_00board for previous years. So I was actually not thinking about that. You were just like, how do I get the best segmentation of these oil palm plantations in this place? Yeah, absolutely. In fact, I was just thinking about how do I get any segmentation? I wasn't even sure how easy this would be. There was a pre-existing map by uh someone called decal and oh yeah that map was only yeah
yeah that was like the first global oil palm map but that was only available for 2019 and we wanted year over year acreages like people want to know for a given year how is it changing is the acreage changing etc and where's where's uh where's oil palm grown
SPEAKER_00in a lot of places, but 80% of the world's production is Malaysia and Indonesia, I think, or some insanely large amount. Some very cloudy places. Very cloudy places. There's some produced in West Africa and some produced in the Caribbean, I believe. But it's like fairly small amounts. Yeah. So if you're interested in, if you're coming at this from a trading perspective, Malaysia and Indonesia are really the countries you care about.
SPEAKER_00Very cloudy places. not a lot of Sentinel-2 acquisitions, but it turns out that there's actually a very, very strong signal in Sentinel-1, like insanely strong. It's almost like if you design- Just in the backscatter. Just in the backscatter, in the ratio between VV and VH. And I think this is because of the morphology of palm trees. Like they don't have a lot of branches below the canopy.
SPEAKER_02Super regular spatial structure. super regular spatial structure so you've got the canopy and then you've got like a very large trunk and on top of that they're in plantations these are planted on like a regular grid yeah so it's so compared to the surroundings it's so unique yep yeah yeah because otherwise it would be like the rainforest right which is like
SPEAKER_00very irregular random backscatter Exactly, exactly. And so that was part of the validation, actually, was just looking at the input features, which were Sentinel-1 composites and feeling like, oh, wow, you can actually really see the regularly planted palm. Now, that's for industrial palm. There's also a lot of smallholder, which is less regular. Okay. But the Sentinel-1 signal is still pretty strong, I would say,
relative to other trees.
SPEAKER_02So did you do some pixel-wise model or something?
SPEAKER_00Yeah. Yeah. So I did, I sampled Decal's map. We basically emulated the Decal map and then deployed it on other years. So I sampled that map for 2019. And you're taking the errors that might be in that map at face value, basically. Yeah. Definitely. But that map, if you go and look at it, it actually does really well in Malaysia, at least,
SPEAKER_00which is where we first trained and deployed. Got it. Just because Malaysia is a fairly, it's like the easiest place to detect oil pump. How come? West Africa is a nightmare. Large industrial plantations. Got it. Not small. Regular grids. There's some, but it's in the minority. And... Just like very regularly spaced grids. Just like industrial. It's industrial. It's the best way I can describe.
SPEAKER_00It's big, hard to miss. Yeah. Whereas like West Africa, it's... It's like small stands, you know, someone might have like a stand of a couple of trees.
SPEAKER_02So these are handfuls of pixels at Sentinel-1 resolution.
SPEAKER_00Yeah, it's a lot harder. It's a lot harder. Looks like noise. For sure. And so when I was looking at the map over Malaysia and then, you know, when you sample, of course, then you plot the samples on the map and then go and check them out. Because oil palm is a tree crop, it's not like a row crop where you're cutting everything down and then starting new the next year. So the underlying high-res base layer in Earth Engine or even Google Maps
is usually enough to show you like you can see oil palm in high res so when you sample the map you can actually go back you can go to high res imagery and if oil palm is there in the high res imagery then it's highly likely that it's still there in 2019 because uh all palm stands get cut down on the order of like 25 to 30 years
SPEAKER_00they stick around for a long time so that's again another piece of How old is the high-res over Malaysia, for example, that you were looking at? I guess you never really know, right? This was just the base map. I used Mapbox, Google Maps.
SPEAKER_02You'd have to go to Google Earth to figure out the dates, maybe.
SPEAKER_00Yeah, yeah, yeah. But the thing is, if it's there... Right, right, right. The high-res layer is not going to be older than 25 years. And also, the other thing is that if something is... oil palm even when the stand gets cut down and replanted they're probably going to replant oil palm so there's like a two to three year gap between planting and maturation where the the tree is not uh productive it's young young palm they call
it but but basically you want to classify the stuff that's not young palm probably
SPEAKER_00right if it's exactly i see Yeah, yeah. But basically, if you get any confirmation that any pixel in Malaysia has ever been oil pumped, there's a very, very high likelihood it's still oil pumped. Yeah. Like at any point in here, since we've been collecting data, like I don't know if that's going to remain true, you know, because like economic forces or whatever. But when you're trying to validate your samples that way, This was actually a really interesting project because I had to
talk to a lot of
SPEAKER_00people who had themselves spoken to farmers. I did a lot of research about just the economics, the agricultural practices, and trying to incorporate all of that into the validation, I guess. This knowledge of the young palm, the replanting cycles, that kind of stuff. And then as you're looking at more and more, and as i'm saying this i'm realizing that i used a lot of high-res imagery to do this actually as you're looking at more and more imagery you're
just getting more and more of a sense of how things look and then you start being able to tell in your input features even though they're much coarser yeah um once you have that
SPEAKER_00mapping in your head right but But it's true that actually... I mean, that's the thing about validation. Once you kind of boot up your brain with all the relevant signals and you do the
SPEAKER_02toggling between all the things you need to toggle to get confirmation, there comes a point where you can just look at the original map you created and you can see all the errors before doing any of the checking. yep it's it's kind of weird i mean your brain enters a different state yeah humans are state of the art or i mean i guess some humans the ones that are willing to go and look at the data but but after a while you really can tell um uh it's kind of
SPEAKER_00it's a little similar to mushroom hunting actually yeah after a while after a while you can just like the mushrooms they just appear like you're not focusing on them but like your brain has somehow got like this rough shape of what they look like i just think it's like you you are like you teach your brain this new particular vision skill and then yeah once you actually learn it
SPEAKER_02it's like you're just doing it
SPEAKER_00Yeah, and it's not a hard vision skill. Yeah, yeah. I mean, I think it's like if a model can do it, like if there's signal, then it tends to not be a hard vision. Yeah. But I guess high res is just like... slightly different thing to your brain it's not that you're training to find all the palm it's like your model did that it's like you're training to find all the places where it didn't work yep yeah yeah and um so
so anyway you know i deployed this map and i still wasn't i don't know i think i got a little scared to be honest like once i realized they were really interested in acreage like i i kind of realized that this this map could be totally wrong it could miss every palm pixel in malaysia yeah and still get the acreage right yeah and i just started thinking like what are the odds that the acreage is you know the
SPEAKER_00year over year acreage matches what's released by the Malaysian palm oil board. And I just started feeling like, you know, it turned out to be decent actually. And we had to make some corrections to it. But at that point, you know, I had deployed it. I was starting to look at it. And I realized another thing that I did immediately was instead of looking at each individual year, I would take two years and do like a difference map. Because what I was interested in
Yes, or where there was basically a disagreement between two years, right?
SPEAKER_00I don't know why. I just felt like those were the most interesting places for me to go and look at. And also... I guess we are interested in year over year variation as well. So can we see where palm is being cut down? And can we see where maybe new palm is maturing into it? Because young palm is actually not very clear in Sentinel-1. I think maybe the canopy has to reach a certain size or the
trunk has to reach a certain size. But basically you could see pixels coming into the map and pixels leaving the map. And I used a lot of those areas to do validation because where there was agreement
SPEAKER_00year over year, I kind of felt like, all right, this is as good as it's going to get. The maps seem to agree. So did a bunch of validation there. And then the plan was, so Malaysia is kind of a known quantity. Like they trust... the Malaysian palm oil board. Um, but Indonesia is a bit of a black box and Indonesia produces more palm oil than Malaysia. And there's less reliable data.
SPEAKER_00Yeah. They don't trust the government statistics. Um, and so the idea was, okay, then you're going to deploy over Indonesia. Once you feel like you have a good map and it looked decent over Malaysia. Um, And so the second round was like, OK, deploy over Indonesia, and then maybe you'll add some samples to your dataset there. That was, so first of all, like a different geography, like, you know, similar region, but it's, you know, technically out of sample, like even more out of sample than a different year,
SPEAKER_00right? Like now you're talking about like geographically out of sample. And as I was scrolling around in Indonesia, I realized there was like a ton of like feral palm, apparently like that. That just, that's a thing. Yeah, like wild palm. And you can kind of see it in... The high res again, like you could kind of see, and now it's a question of like, okay, is it out of date or, you know, something like that.
SPEAKER_00But I think there's also something about the shape of your detections, which can tell you, you know, if it's like very spotty, like salt and pepper, you kind of know something's up. And if detections are clustered together, like they're making shapes, like something's happening on the ground. to make that signal appear basically like a geographically consistent signal in a pixel wise model i think it's a very strong indicator of something like that's
something that i'll go look at when i'm validating as well uh for sure and but then
SPEAKER_00in I think it's West Papua. Yeah, West Papua. There was a ton of like, I couldn't tell if it was mangroves or something that was definitely not oil palm. It just didn't look like it. Like the detections, it looks like actually mangroves. Like it was along rivers, which didn't really make a lot of sense. Right. And it was just off. I can't... I don't know how else to describe it, really. But the high-res imagery...
You had done all this work to teach your brain what it looked like.
SPEAKER_02And your brain said, this doesn't look right.
SPEAKER_00Yeah, it doesn't look right. I guess, yeah, trying to put it into words now, it was like, along a coast... but it was like a delta, and I just hadn't seen another place like that as I was validating in Malaysia or Indonesia. And it just didn't make sense, right? If you have a plantation, you want easy access to the oil palm, you want roads, you want to be able to drive and transport the fruit back to the processing facility.
SPEAKER_00And I couldn't see any roads in this area. It looked pristine, actually. So thinking about it now, that was probably another thing I used, which is basically the presence of any infrastructure or... buildings even, right? Like people have to live near the plantation to go and work and harvest. And so, um, so, so hold up for a second.
SPEAKER_02So you deployed, okay. So you trained in Malaysia, you had reasonably good government data, so you could do some, I guess, adjustments. And then you were looking in Indonesia and then you were looking at all the other places that have less reliable data and So my question is, if we could just take a step back. So after you deploy your first version of the thing, you get a map and you did validation with high res and you taught your brain to
SPEAKER_02figure out what looks right and what doesn't and all these things. What did you adjust after that first deployment? Like, did you change any input data sources? Did you do post processing as a result of what you discovered from your validation? Or was it just good enough? And that was that?
SPEAKER_00Great question. So again, because we were not interested in the map itself, we were interested in the aggregated number. When I plotted our aggregated estimate versus the palm oil board's estimates for acreage, there was something that looked, it wasn't a constant bias, but it was like a smoothly varying function, if that makes sense. It was way too low in 2018, and then the gap was decreasing.
SPEAKER_00And then in 2023, it was getting closer. So we actually, Like I thought about this and I was kind of like, okay, I can probably like bash this model over the head until it's like a constant bias or something like that. Like maybe sample points that I can confirm myself from 2018, but that doesn't feel,
SPEAKER_00it doesn't feel like the right thing to do. And so I thought about, we went and we thought about what kinds of processes could lead to this. And we found out that they had basically stopped planting new palm at some point in like 2016 or 2017. So basically we kind of built like a really simple model
SPEAKER_00to use a, there was like an existing oil palm age map and we went and we took, we basically aged out. Like we basically did a constant correction for like a lower than three-year-old palm. Yeah, yeah, yeah. And that turned our map into like a constant bias basically. Wow. Because it corrected for, yeah. Cool. It was pretty cool actually. And obviously we had no idea if this was the thing,
but it felt defensible.
SPEAKER_00You know, like I think with the traders and the people going to sell this, they just wanted to know like, are we within 4%? There's always a number. You have to be within X%. That's what the trader tells you. You have to be within X%, whatever that means. And so this bias correction using an existing oil pump age map by, I believe her name is Olga Danilo. It was a pretty cool paper that didn't get a lot of press or
whatever, but... this age-based correction actually turned us from a like varying bias year over
SPEAKER_00year to like a constant bias. And then once we had that, you know, it's like, okay, we're matching the year over year variation in acreage, which is what the traders are interested in. But, you know, we had like five data points.
SPEAKER_02Yeah.
SPEAKER_00Like, you know, it's kind of, you just do your best, right? Right. So that's what we did. Yeah. After the first map. You want to talk about something you've done recently with validation?
SPEAKER_02What have I done? I guess I could start by talking about land cover mapping at Impact Observatory. That was maybe one of the bigger validation exercises that... that i um worked on so just to set it up a little bit when i joined impact observatory we were building the first version of esri land cover so we were trying to build a global map global land cover map at 10 meter resolution with sentinel
SPEAKER_00the first one right
SPEAKER_02Yeah, we were trying to do the first one. This was a little bit before Dynamic World came out. And we had a globally stratified data set. So this is a data set that was sampled across, I believe, all the continents. I think I'm correct in that. And across a bunch of different biomes and ecoregions. So it was very geographically diverse.
a sentinel 2 acquisition with some date so this isn't some composite this is just um the actual acquisition at a particular point in time a 512 by 512 chip at 10 meter resolution and then a corresponding segmentation map so another 512 by 512 Um, we were doing a, I think a nine class or a 10 class, depending on how you think about it.
SPEAKER_02Um, broad baseline cover map. So the labels were created through a third party. So, um, a company, um, I think it was scale AI, um, a bunch of people from scale. Yeah. A bunch of people from national geographic went and taught a bunch of people at scale AI, what land cover looks like. So this is kind of cool. This is like, this predates me joining the company. Um,
SPEAKER_02But very cool. So basically, people who knew what land cover looked like went and showed other people what land cover looked like. And then those people, once sufficiently trained, started marking up these scenes. And... The labeling approach was interesting because it wasn't a pixel-based approach. It was like polygon – like imagine drawing polygons around these boundaries of things. So imagine a scene where you have roads and silos and fields.
SPEAKER_02It's pretty common, right, for a lot of agricultural areas. And so you'd see these broad – You see nice, clean transitions between all these land cover things, but you're not getting a lot of the kind of pixely delineation of imperviousness or bare earth or all these other things. You're kind of getting a more... human holistic view of what land cover looks like. Anyways, this was the data set, unbelievable data set.
SPEAKER_02So, um, you know, I went and did a bunch of experiments to figure out a model that would work for this. Um, and we ultimately landed on a unit. And so we trained a unit from scratch, um, uh, there were at the time a lot of i think justifiable reasons to choose this model um spatial context seemed like a really important thing and so um i feel like you could easily convince yourself of this when you're looking at
the data set if you
SPEAKER_02saw rows of fields the things next to them seem to be spatially informed by the things around them. And so the thinking there was that because that is the case and our eyes can pick up on this pattern, if we just did a pixelized model, we are throwing out some of this relevant spatial context, like what is surrounding this pixel, right? And so units are very good at capturing that kind of spatial context. And so we chose to do that. Yeah, sorry, go ahead.
SPEAKER_00Can I ask... When you're doing the splitting of the training and validation set for these tiles, are you doing that based on like a histogram, like counts of the classes? Are you trying to like stratify the tiles across the classes somehow?
SPEAKER_02Yes. And so if you just forget about the split for a second and you just tally up... all the land cover types it's a highly skewed pixel count right like there's lots of forest and there's lots of um there's lots of you know barren land and you know there's a lot of those classes and there's very little of built areas and there's very little of um you know snow and ice and
And so even though this was like somewhat stratified in choosing the areas to
SPEAKER_02sample, once you choose your like centroid of, okay, I'm going to build a tile around here. Um, you're choosing, you're ideally choosing areas that have some diversity within that 512 by 512 pixel, right? Like if you sample the middle of the Sahara desert and every pixel is the same, is that super interesting? Probably not. And so, um, yeah, But yeah, you end up with kind of a representation of reality. So you end up with the fact that the world is highly skewed in terms of land cover. And that's what you get in your data set.
SPEAKER_02And so I think the way we ended up, I'm forgetting all the details of what we did, but I think the way we ended up doing it was to split to make sure that in the training and validation set, we had representative samples. across like we didn't want the training to just be in one continent and that not to be represented in the validation set you know so like some kind of geographic sampling but then some kind of some kind of stratified sampling
as well to make sure that within the pixel distributions that we had we had like about the same
SPEAKER_02percentage of built area in the validation as we did in the training And so that's kind of how we did that.
SPEAKER_00That's a hard problem. I don't know if there's an excellent one-size-fits-all solution to that, but that's what we did.
SPEAKER_02So anyways... You know, we trained that model. It looked pretty good. And then I still remember the first time. And then, you know, a lot of engineering work was happening parallel to be able to run this model over much larger areas. Right. So there was this nice sweet spot where we had put a pin in a model that looked pretty good, you know, as good as it can possibly look from some very small validation set. OK. And then but then we're able to deploy that over like.
all of santa fe or like all of greater santa fe or uh-huh you know we'd pick these much much larger regions like mgrs tile level regions and so all of a sudden we're
SPEAKER_02looking at a much larger geography from the model. Um, kind of for the first time, I still remember what that felt like. It was crazy. And, um, you know, because of the, because units are better in the middle and less good in the edges based on, um, padding and all that stuff, you know, we do overlap with the tiles and we stitch all that together with GDAL. So we're just taking the middle portions of the predictions as much as we can. So we do all that and we deploy over this larger MGRS tile. And it's this like, uh,
I would say that's where kind of the true validation work began because up to that
SPEAKER_02point, we had gotten... we had made some limited progress with metrics of like, you know, if I split the thing this way, then the confusion matrix looks like this and my validation confusion matrix looks kind of like my training one. And so I'm reasonably happy and I'm beating down some of these errors between shrubs, scrub and grass, which is like horrifically difficult to tease out. But as soon as we deployed over a huge place,
SPEAKER_02It's kind of like, again, what we were talking about earlier, your eye is seeing this very regular spatial continuity, right? So then these maps, thankfully, the first time we did this actually looked quite good. You saw this beautiful spatial continuity between delineation of urban areas, kind of rolling into shrub scrub in the case of Santa Fe, or agriculture looked really good next to... uh yeah next to the built areas and roads that were around it
and so it looked cool um so we just spent a lot of time looking at those and so when you say when you say you were looking so you're overlaying the map you had produced with what with
SPEAKER_00imagery
SPEAKER_02Yeah, so it was produced with Sentinel-2 imagery and Sentinel-2 imagery alone, at least the first passive it was. And so we just toggle a Sentinel-2 composite on top of the map, and we'd look at it that way. And so that gives you... pretty nice spatial correlation between the two but then we'd kind of do the same of what you did is when you look at it on top of high res so in the u.s i remember we were looking at it on top of nape uh and and and that would give us a sense of
sort of like what is the true coarseness of this product so if you're comparing you know one meter or 50 centimeter imagery to this 10 meter product the hope is that
SPEAKER_02you see the right spatial patterns but then you lose a lot of the like you know, especially kind of like the built area detail. And that's what we were seeing. So that's how we were doing some of the qualitative validation. But because land cover is a fairly well-studied field, you know, within remote sensing, in the US we have NLCD to compare to. So the class taxonomies between the two don't match. But still, it's a pretty good proxy for figuring out whether you're doing
it doing well. and we were actually able to look there's there's some places where it's kind of known that nlcd isn't that good and so we would look in those places and see if there was disagreement between our map and what nlcd was saying and that started to give us more confidence that things were working or things weren't working um and so that's kind of how we did those places i'm trying to think i think i want to say
SPEAKER_02like like oil and gas country in Colorado. Oh, like the San Juan Basin or something? Yeah, yeah, yeah, yeah. There's places there where NLCD didn't do that well.
SPEAKER_00Do you remember what classes? Is it not detecting the well pads or roads or something like that?
SPEAKER_02Yeah, I think it was... I think there were some Wellpad misclassifications that could have been attributed to like some year stuff that wasn't the case. But I think some of the other problems were in the Midwest, like in the grassland areas. Where a bunch of stuff would get uniformly classified as grassland. But if you looked at kind of the spectral signatures of what happened in that
SPEAKER_02particular year, like it was maybe overclassifying grass. Huh. Yeah. And so... Interesting. There were all these other situations where NLCD wasn't perfect. And NLCD, I would say, is still kind of the gold standard. Like, I don't think our global map is doing better than NLCD. It definitely wasn't.
SPEAKER_00It's a harder problem.
SPEAKER_02Yeah. We were trying to generalize to larger areas. Yeah. And so... But those were data that we had to check, right? And so... It wasn't even about us trying to fit to that data set. It was more trying to just... It's just in this mode of where you're just throwing data, as many pieces of data as you can to the map to see if your brain can make sense of it. For sure. And I think what we landed on was that... At least what I came to the conclusion of was the labeling process...
SPEAKER_02you know, many months of labeling process through this external company is basically highly imperfect. Yeah. And our model is basically as good as that. Right. And beats down the like small local errors that labelers make through the training process. Right. Like the smoothing? Yeah, but it smooths through that. But basically, it's just, it's doing that style of delineation. And so,
I think we got to a point where we convinced ourselves that it was doing that and
SPEAKER_02that was basically what we could hope for. And... We had some good, surprising success when we deployed over certain regions in Africa, like in West Africa. And it was picking up small built areas that don't look at all like what built areas look like in the Western world. And it seemed to be doing a really good job at that. And again, this was because that was actually fairly well represented in our data set.
SPEAKER_02And so, yeah, we just kind of cruised the world looking at this map and finding all the places where basically it was imperfect, but okay. And we just kind of knew that that's what this map was going to be.
SPEAKER_00How many of you were doing this?
SPEAKER_02It was me and a few others. Caitlin Conscious was super involved in doing a lot of the validation, and she has such a deep background in... geography that she's like knows what she's looking at when she's looking at this map in Vietnam and you know all these places that I just have way less experience looking at so she was instrumental in doing some of the validation and Zoe was looking at it and a bunch of other people at the company were
looking at it but we were looking at it I think there were a handful of us that were kind of looking at it the closest Steve Brumby definitely looked at it really really hard too um yeah i would say weeks and weeks but um but it was but it was all kind of quick yeah i guess it's like you because it's dense labels you know are you going to go and relabel and then introduce new training samples did you guys do that actually
we did at a another point in time collect more data but that was not what showed up
SPEAKER_02in the first version of the model And it's actually not clear whether the addition of more... I remember we studied this. It wasn't clear whether the addition of more data labeled the same way actually helped the model at all. In fact, it might not have. With the dense labels, it's just so much harder to produce a lot more to influence the model. Yeah.
SPEAKER_00Someone has to go and draw all of the shapes.
SPEAKER_02Yeah. And one thing I kept thinking of that I still think about a lot now is like accuracy as a function of zoom level. This is kind of what you were getting at with the acreage. It doesn't matter if the map is right as long as the acreage sums up. We weren't quite in that situation, but... If you look at an MGRS tile, which is pretty large. I don't know if you know the size of that off the top of your head. Is it 10K?
SPEAKER_00Or I think it depends. Okay.
SPEAKER_0210 kilometers? Call it 10K. If you're looking at it at that zoom level... um like the map looks exceptionally accurate and if you zoom in beyond that the map still looks really good at a regional view and then as soon as you zoom into like a tiny neighborhood you see the imprecision of the map and then sort of like that's the only thing that you see um and It's a hard question to answer of like, is the map good enough?
SPEAKER_02Is it useful? Like the map is definitely very useful for regional statistics and regional change over time and trends and all that stuff.
SPEAKER_00Or just like a mask.
SPEAKER_02Or a mask. Yeah. But is it useful?
SPEAKER_00It's like, is it mostly right?
SPEAKER_02Yeah, but is it useful for like identifying all these specific built areas that have been constructed? Like maybe not, you know?
SPEAKER_00Yeah, I just realized it's 100K. 100K. 10,000 pixels, I think. The big square ones. Yeah, yeah, yeah. Yeah, I mean, that's the other thing is, you know, you're validating sometimes. You're not really validating... even necessarily to directly improve the model or to see how good the model is, you're validating to see if it's good enough. Like, can I stand by this? Is there enough signal?
SPEAKER_00Can I reason through what I think the model's doing? Yeah. Do I get a sense of where it's not doing well? Can I communicate that to the end user? And then that's kind of it.
SPEAKER_02We did ultimately, the way we designed our system was that we did ultimately have knobs that we could tweak to satisfy the customer. So we were in an interesting position where we were making this map for Esri. And a lot of people at Esri know a lot about land cover and remote sensing. And as we were making, I remember we would like, we would be making this map and sort of iterations. We'd be like, okay, we're going to do all of South Africa and we'll deliver it.
SPEAKER_02And some folks, as we can go look at it and, um, I thought we built the map actually in a kind of smart way such that we did have knobs that we could tweak. So the way our model ended up working was that we ran the model over every Sentinel-2 scene that... wasn't uh at least x percent cloudy i forget what that exact number was and so we have a stack of predictions across a year and then there's a
question of how do you collapse all those prediction predictions into a single classification for that year right and the most naive thing you can do and i think what a lot of people do with dynamic world or whatever is you take the mode so the most commonly occurring
SPEAKER_02class um is the class that you choose um This actually ends up not being the optimal strategy for a lot of different land cover classes. And a lot of that is governed by knowing about geography and knowing about what's happening on the ground. And so grassland is a great example. So grass is only going to be spectrally detected as grass in the time when it is
SPEAKER_02sort of like green and detectable. Yep. And in large portions of the upper Midwest, that period of time is not very long. And so spectrally, a lot of the year, that looks like shrub scrub and not like grass. So if you did a mode, the entire Midwest would just be classified as shrub scrub.
SPEAKER_00Did you guys use any geographic rules? We did. Grass. You did.
SPEAKER_02Yeah. And so I think this kind of gets to how you... This is all learned through... Yeah. I mean, the validation process, right? It's like, yeah, we had different rules. So basically... So let's take that mode, right? And so the mode is not optimal. So ultimately what we ended up doing was a class weighted mode where we manually set the weights that you would apply to a mode operation of all the valid
classifications that you had at that pixel across the year based on what we knew about the ephemerality or not of that particular class in that particular area.
SPEAKER_02Whoa.
SPEAKER_00So, okay, taking the example of grass in the Midwest. Yeah. So, like, over those areas, you would heavily weight grasslands.
SPEAKER_02It's not even particularly heavy in that case. It's, like, I think it would, like, maybe have a 5 to 1 factor. Okay.
SPEAKER_00Compared to... Do you have more complex rules? Like, anything more than, like, a weighted mode? Like, if... the transition is bare ground to grass, it's probably grass. But if it's like built area to grass, I don't know, or grass to built area, maybe it's construction or something like that.
SPEAKER_02It's possible that more complicated class transitional rules exist now. When we made the first version of the map, that wasn't the case. So everything fell within the class-weighted structure for simplicity of deployment and the ability to just tweak numbers and have different maps and so but it but it ends up but you can kind of indirectly get at that through setting these weights cleverly and so with snow and ice it's like we basically never wanted if it was if that pixel was ever
detected as anything
SPEAKER_02other than snow ever call it that And so you can formulate rules like that by setting the weight for snow and ice very, very low. So you can kind of cheat a little bit at some of those inherent transitions by tweaking your weights. And we did have different weights for different regions. We didn't have so many different areas that we had to manage all these areas,
SPEAKER_02but I remember in... in africa like because of the way built area showed up and because of the way agriculture showed up the weights were slightly different from like uh what it would be in north america and so we did we did have like regional specific things and again as we're making this map and generating over more places we know we we would tweak a little bit and it was nice because the customer i
remember the customer esri at one point being like we need to have higher sensitivity to small holder um
SPEAKER_02ag in yeah in West Africa and we were able to like change a number and like actually just gain more sensitivity, which sounds a little fake, but it's not that fake because like at some point in the year we are detecting that and we're just waiting that more heavily.
SPEAKER_00Yeah. That makes a lot of sense. I mean, it's kind of what you want. You want like easy knobs that you can turn if, if, if you have a model that supposedly one-shots everything, no post-processing, just the model outputs, good luck tuning that, good luck changing it. And I think it maybe makes validation less valuable, like a less valuable part of the process of iterating.
SPEAKER_00Did you use any other data sets like elevation?
SPEAKER_02All the other data sets that we looked at, including elevation, including NDVI time series, and all this kind of stuff, we did after the fact, after the first version of the model. So the first version of the model didn't use elevation or anything like that. yep yep but those are obvious it's just again scoping the problem yeah given a
tight deadline and yeah for sure how much time did you guys have to do this um i want to say the bulk of the work happened in months like not not just the modeling
SPEAKER_02but the the engineering the deployment yep yep yeah
SPEAKER_00Yeah, it's interesting, the thing about NLCD, I just think you always have to overlay something else to get a sense of... And I think we spoke about this in the embeddings episode, but maybe that's the value in lots of small, highly imperfect, cheap-to-make maps. Yeah. like being able to just overlay something else like what does this model think or you know kind of like asking that question like um where does
my map do better like often you have to show you have to justify the existence of your model right yeah oh look here the other map missed it and mine mine caught it therefore this wasn't
SPEAKER_00a total waste of time What are your favorite... So we're talking about putting a bunch of layers on the map.
SPEAKER_02I'm curious what your go-to tools are for doing the validation bit. After you deploy your model, how are you putting all these different layers on? How are you looking at them? What are you using for that?
SPEAKER_00I... I used GMAP, I think, or Leaflet. And the reason for that is there's just so many data sets on Earth Engine and here we go again. And it's just so convenient to look at, especially with the community data set, you can almost always find
SPEAKER_00a dataset that's relevant to yours, to your map somehow. And so I think I ended up using GMAP a lot just because of that. And because I haven't quite figured out the Google Earth Engine plugin in QGIS. But I do end up struggling a bit with vector data, to be honest, as a result of that. uh but yeah that that's that's what that's my go-to got it yeah i um i love ge map and i use it so much in development and to throw layers on the
map but when i'm doing hardcore validation i pretty much live in qgis and i always get to a point
SPEAKER_02where i have my outputs in tangible tiff form yeah or and then i think qgs is sort of unparalleled in what it allows you to do so just like ge map you can So GE map, you can select between different base maps and stuff. And there's the Google satellite one and the Esri satellite one. So you can add all of those as QGIS. Those are all just free tile servers, right?
SPEAKER_02So you can just add those as QGIS layers. And then in QGIS, you can add... Anything else you can possibly dream of all into the same map. And you can style them to have different... I find the styling to be really useful for validation. So I'll often blend two different layers together where I know that if... Things are going to line up and look right. The blend is going to look a certain way. And if they're not going to line up,
the blend is going to look a certain way.
SPEAKER_02Does that make sense? Yeah, it does. Yeah. And so QGIS just gives you infinite flexibility and blending modes and changing. You know, I know in GE math, they can change the opacity of things. There's also something about the responsiveness of QGIS. If you're constantly hitting some endpoint to keep rendering as you're panning, things can start to slow down. And if you just have things as tiff, then things are super snappy in QGIS.
SPEAKER_02Yep. Yeah, I find QGIs to be super invaluable. And then where it really shines is the combination of raster and vector data. So you take natural earth, you take roads over here, you start putting all of that on the same map. And it's like you're almost building this visual evidence thing. of whether your map is correct and you're kind of proving it to yourself and building a visual at the same time that you can share with somebody else.
SPEAKER_02And so, yeah, I just, I cannot, I don't know what I would do without something like QGIS to do the validation.
SPEAKER_00Yeah. That was where, so there's a really cool, um, Street View plugin in QGIS, where you can not only click where you want to open Google Street View, but you can actually choose the direction. You can draw an arrow in that direction. So you're making sure you're facing the direction you want to look at. And that was the inspiration for the little widget I made. But that was invaluable when I was labeling T.
SPEAKER_00to just be able to drop in to a field and look at the crop. Yeah. That was huge actually.
SPEAKER_02Yeah. And then you can pull in OSM data with the OSM plugin in two seconds of QGIS overture maps. Um, yeah, Yeah, the Earth Engine plug-in, it's a little wonky, but it works. But it's just, yeah, the flex. And then, actually, oh, what I use a ton. I didn't use this during the land cover stuff. I have used this more recently in the past couple years, but... The labeling tools in QGIs are really, really good.
SPEAKER_02And so, again, it's just like everything's kind of clunky. It's like point-and-shoot desktop software from the 90s vibes. Yeah, million buttons. But the ability to draw... whatever polygons you want over i i constantly am drawing polygons like flagging areas where the model is wrong or flagging areas where i know it's like i don't have to actually fix this in my model i'm just going to mask it out in my final result um oh i do that all the time so um that makes a lot of sense
it's like there was this huge you know there's this huge swath of open land where my model has a ton of false detections but i know there's absolutely nothing there it's like i don't have to fix it i just you're gonna mask it out yeah yeah that that's the um high recall low precision property where it's like easier to remove detections from your map especially if they're like spatially coherent and like yeah it's like as opposed to like oh my my map missed this like even just to find
where it missed a certain thing without a reference map is hard to begin with um yeah that's interesting did you use uh qjs at io when you were making the map is that what
SPEAKER_00you're doing the validation in I did do a lot of validation in it, and it was a common language to be able to share...
SPEAKER_02because we did group validation. So it wasn't just me. We had other people looking at stuff. And so it's kind of nice. We would like share QGI's projects around and we would make sure that we make a TIFF file that we know looks the same and everybody's QGI's project has the same color palette. Everybody's looking at the same thing. Everybody has the same base layers they can put on different stuff. And so that's the other, I mean, it's, I'm not going to pretend that it's some like super, shareable thing like you have to move files around it's clunky
as hell but but also it's just it's a thing that lets you do the work really well I think yeah I have
SPEAKER_02yeah it's just so good yeah Yeah. Well, looks like I need to start blending some layers. Definitely blend some layers. I mean, so many maps that I make. It's like my job now is to... I make graphics as much as I'm doing analysis. And so much of what you see in graphics in news or other places is because... it's not just one layer that you're looking at it's a blend of a lot of different things it's satellite imagery on top of hillshade that's being
multiplied that's having another layer on top of it that's just highlighting areas of high ndvi and then there's another layer that's just styling the water a certain way and all of the combination of that plus all your raster layers you know roads or sorry vector
SPEAKER_02layers the roads um All of that is what you need to make graphics. And so it's not just, yeah, it's really, really cool. And you can really go down a deep rabbit hole with all that stuff.
SPEAKER_00So you can, when you said blending, I was just thinking like, okay, I've got a probability map output by my map and I've got an underlying composite. But you're saying more than two layers, like a ton of them, like a ton of auxiliary information.
SPEAKER_02Yeah, I mean, some maps that I have made have like 20 layers on them.
SPEAKER_00And you're blending them all together when you're validating them? Or just validation, but I'm saying just to like make final maps or final graphics too.
SPEAKER_02For validation with the probability composite example, it's like maybe you want to do like an inverse multiplication where you're just highlighting areas of low probability, for example, and looking and being able to see the underlying imagery of where it's low probability really clearly. Yeah. You can do that via a blending mode. As opposed to toggling back and forth all the time. You know what I mean? yeah yeah but i guess you know if i'm thinking about doing this
in gmap then i would multiply the do like an earth engine operation to multiply the rasters it's just in qgis is that equivalent yeah exactly but in qgis it's like you have so many blending modes at the click of a button whereas the in ge map you know it's like for every kind of thing you want to do it's like you're increasing the amount of thinking and work you have to do to accomplish that it's less it's less sort of like you just flywheeling fearing out what works more like you
being super deliberate and qgis lets you lets you not think as hard and you have a lot of
SPEAKER_02options that make sense yeah yeah this is this is actually very relevant to me right now so i'm gonna what what kind of blending like what other blending modes are available like yeah there's like a screen dodge uh lighten darken um multiply uh just a straight overlay and Just sometimes even just changing transparency of things is huge. Setting like custom no data values for a certain map so that
it's not showing up.
SPEAKER_02Like you can just do all of that stuff instantaneously.
SPEAKER_00Whoa. Yeah. Okay. And so you kind of just played around with this stuff long enough to like now you have a sense of what you want to use given the problem you're trying to solve and then also how it should look. yeah yeah it's really it's really worth in my opinion it's really i think this is something that i think is overlooked by a lot of people who are more engineering data science oriented because it's a piece of desktop gis
software it's like why do you need it kind of thing yeah clunky what is this really buying me but i think it
SPEAKER_02buys you It really just lets you sit with the data in a way that I think I don't sit with when I'm not using it. Yeah, I don't know how else to describe it. Maybe I'm just super biased towards using it.
SPEAKER_00No, I think what you were saying spoke to me a lot about the different layers, the blending, knowing you're just making it easier for your visual system, basically, as you're doing it. yeah and the and um and for me it's like i love playing with color maps for different data and you can do weird breaks on your color maps based on what you know about your data so that you know red really means something and then you kind of like we were talking about like teach your brain to identify
certain things based on this schema that you define and again you can you can do all of this in ge
SPEAKER_02map and other tools but there is a level of ease and customization that you just get with the, with the, with the desktop GIS that you, if you, if you're having to program every single piece of that, it's like the level of interactivity that you get to figure out what the right parameters are is less as opposed to if you're just changing sliders and watching an update.
SPEAKER_00Yep.
SPEAKER_02Yeah.
SPEAKER_00All right. I'm going to go blend some layers. Wow, I can't believe it. I've been talking to you about PJs for like years. I know, but this is the strongest case. This is the strongest case you've ever made as opposed to just use it, you idiot.
SPEAKER_02What are we at time-wise? We're kind of at our usual hour mark where we start asking this question to ourselves. Should we continue? Yeah. wow you have this internal you have this internal clock i know i actually don't have the timer on my end so um oh actually uh alice said last time that we should have like an exit an exit line instead of just being like see ya what's the exit
SPEAKER_00line I don't know. Thanks for listening. Is that the line?
SPEAKER_02Thank you, devoted listeners, for listening to Two Morons Ramble.
SPEAKER_00The Earthside Podcast. That's a good one. That's a good one. Let's call it.
Relevant links:Carbon Plan Open Climate Risk A Risk Professional’s Guide to Physical Risk AssessmentsClimate Risk Companies Don’t Always AgreeClimate Services: The Business of Physical Risk(00:00) Chris Struggles to...
I flew to the East Coast and drank a beer with Krishna.(00:00) Sick New Jingle (00:20) Double IPA (01:20) The Gang Struggles to Define a Platform: Metadata, Storage, Compute, APIs (11:20) The Value of a Platform (16:00)...
(00:00) Time series, Landtrendr, New Mexico, Cuba. Is medium/low-resolution imagery underrated? (15:00) Bayesian Deforestation Detection, operation-oriented algorithms and platforms (27:00) Landtrendr in the West Bank,...
No pre-prepared discussion subject this time, we just winged it. (00:00) Imagine useful geospatial models, it’s easy if you try. (08:00) Academic papers, life at the paper mill, distilled .pub for geospatial. (24:30)...
(00:00) Differences between medium-res and high-res worlds: data sizes, off-nadir imaging, co-registration issues (28:42) High-res SAR/Umbra data detour: building damage estimation in Jamaica, matching imagery up to...