We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Demystifying AI in Geo

00:00

Formal Metadata

Title
Demystifying AI in Geo
Title of Series
Number of Parts
295
Author
Contributors
License
CC Attribution 3.0 Germany:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
You are probably familiar with the terms artificial intelligence (AI), machine learning (ML) and deep learning (DL). However, do you really know how they work with GIS? In this session, we will use Python and various libraries to illustrate how artificial intelligence is used to detect deep and complex spatiotemporal patterns in data, and how to predict geospatial events of interest. This talk will cover several scenarios of applying the latest machine learning and deep learning techniques to geospatial data, including applying object detention using satellite imagery, detecting objects in videos and other workflows to incorporate these data sciences.
Keywords
129
131
137
139
Thumbnail
28:17
Artificial intelligenceProcess (computing)Multiplication signRight angleFood energyGeometryBitQuicksortArtificial neural networkProgrammer (hardware)Line (geometry)Computer animationLecture/Conference
Machine learningInformationUnsupervised learningArtificial intelligenceTerm (mathematics)SubsetAlgorithmEndliche ModelltheorieComputer networkGroup actionMachine learningSlide ruleTerm (mathematics)InformationArtificial neural networkSubsetOnline helpCodeComputer animation
Machine learningArtificial intelligenceTerm (mathematics)SubsetAlgorithmMultiplicationComputer networkEndliche ModelltheoriePredictionEmulationMathematical analysisMathematical optimizationPrincipal component analysisReduction of orderPort scannerSingular value decompositionLinear regressionThomas BayesSupport vector machineRandom numberDecision theoryLinear mapLogistic distributionForestGroup actionFunction (mathematics)InformationRecurrence relationConvolutionData modelModal logicMachine visionObject-oriented programmingPixelSingle-precision floating-point formatProcess (computing)BildsegmentierungCovering spaceObject-oriented programmingComputer-generated imageryMerkmalsextraktionWeightDifferent (Kate Ryan album)File formatRandomizationVirtual machineCuboidSocial classMachine visionMoore's lawReduction of orderLinear regressionForestPattern languageNeuroinformatikLevel (video gaming)Derivation (linguistics)InformationArtificial neural networkWave packetQuicksortPredictabilityAlgorithmMultiplication signResultantWordFocus (optics)Object-oriented programmingDimensional analysisType theoryBookmark (World Wide Web)NamespaceComputer hardwareAnalogyInternetworkingFitness functionConnectivity (graph theory)PixelEndliche ModelltheorieMedical imagingSoftwareNumberOpen sourceFunctional (mathematics)Black boxMathematicsBayesian networkMultiplicationReading (process)Logistic distributionComplex (psychology)Forcing (mathematics)Port scannerArithmetic mean10 (number)Graphics tabletBoundary value problemMessage passingCoefficient of determinationMachine learningGame controllerTexture mappingComputer animation
WeightConvolutionComputer networkPixelBildsegmentierungComputer-generated imageryComputing platformContent (media)Server (computing)Service (economics)Component-based software engineeringDisintegrationEndliche ModelltheorieData modelModule (mathematics)Social classSatelliteBit rateInferenceData managementMachine learningEndliche ModelltheorieGraphics tabletComputing platformPower (physics)Covering spaceoutput1 (number)Service (economics)Raster graphicsInstallation artGraphical user interfaceCoefficient of determinationRepository (publishing)SoftwareFreewareInterface (computing)QuicksortSemiconductor memoryPixelDemo (music)Wave packetFrame problemAreaSemantics (computer science)Set (mathematics)CuboidGene clusterModule (mathematics)AlgorithmAutonomic computingUniform resource locatorCartesian coordinate systemSimilarity (geometry)ExistenceSocial classVirtual machineMedical imagingWeightSlide ruleLibrary (computing)Server (computing)Standard deviationAnalytic setMoistureProcess (computing)Point (geometry)Sign (mathematics)Machine learningCodeWorkstation <Musikinstrument>AverageGeometryComputer animation
CodeObject-oriented programmingCalculationSimilarity (geometry)Gene clusterNumberUniform resource locatorError messageDistanceGroup actionComputer animationLecture/ConferenceMeeting/Interview
Cellular automatonCluster samplingInclusion mapFrame problemDisk read-and-write headView (database)Gene clusterNumberMoment of inertiaError messageSquare numberSummierbarkeitDistanceGeometryResultantElectronic visual displayDemo (music)Mathematical analysisCASE <Informatik>Shape (magazine)2 (number)Element (mathematics)Uniform resource locatorComputer animation
Perturbation theoryCalculationCluster samplingNumberRange (statistics)Function (mathematics)VarianceProcess modelingMoment of inertiaPlot (narrative)Source codeGraph (mathematics)InformationMarginal distributionAngleLevel (video gaming)State of matterVector spaceCurve fittingNumberGene clusterDemo (music)Electronic visual displayResultantMultiplication signHydraulic jumpRainforestVirtual machineComputer animationDiagram
Grass (card game)Machine learningRandom numberView (database)ForestMeasurementVirtual machineAlgorithmKernel (computing)Decision theoryPredictionSurfaceLocal ringStructural loadFrame problemData modelDisk read-and-write headShape (magazine)Floating pointData conversionMorley's categoricity theoremVariable (mathematics)Beta functionMatrix (mathematics)Cross-correlationCorrelation and dependenceEmulationCartesian coordinate systemSoftware testingPressure volume diagramString (computer science)LoginTestdatenMusical ensemblePlot (narrative)Optical disc driveError messageEstimationCalculationPredicate (grammar)Letterpress printingAbsolute valueComputer-generated imageryImage resolutionTexture mappingLaserContent (media)Raster graphicsInversion (music)SineSample (statistics)Asynchronous Transfer ModeExpert systemStapeldateiMassTransformation (genetics)Logic gateBit rateRule of inferenceInsertion lossElectronic visual displayGraphical user interfaceCurve fittingMiniDiscEnterprise architectureMathematical singularityModal logicInstallation artQuery languageoutputComputer fileInformationScripting languageObject-oriented programmingService (economics)Mathematical analysisInformationField (computer science)NumberCASE <Informatik>ForestComplete metric spaceVirtual machineGreen's functionLine (geometry)Software testingCovering spaceCross-correlationPredictabilityCuboidMorley's categoricity theoremPixelDemo (music)Multiplication signOrder (biology)Parameter (computer programming)Bit ratePlotterEndliche ModelltheorieComputer fileMiniDiscFunctional (mathematics)Pattern languageShared memoryWave packetAreaWater vaporResultantInsertion lossUniform resource locatorVariable (mathematics)StapeldateiServer (computing)Point (geometry)Execution unitAlgorithmSemiconductor memoryWeb serviceRainforestRandomizationComputing platformData modelMereologyKey (cryptography)SpacetimeOnline helpConcentricSingle-precision floating-point formatSampling (statistics)DataflowLocal ringWorkstation <Musikinstrument>CodeService (economics)Set (mathematics)DivergenceBuildingFrame problemStructural loadGrass (card game)Reading (process)Game theorySocial classSource codePunched cardRight angleCalculationTunisTexture mappingCopyright infringementLink (knot theory)Visualization (computer graphics)Category of beingComputer animation
Object-oriented programmingData modelMultiplication signAreaMessage passingVideoconferencingSingle-precision floating-point formatWell-formed formulaReal-time operating systemRight angleFluid staticsComputer animationLecture/Conference
Transcript: English(auto-generated)
So, we'll close this lot of talks with the mystifying AI in jail by Andrew Chapovski. He also hold a little bit of small talk during the slot that were opened relating to Panda.
So hopefully he has the energy and strength to close up this one. Enjoy. Hi everybody. Everybody say cheese right before we go to dinner? Alright. So, thank you for coming. This is a talk on demystifying artificial intelligence in geo.
And there's been a lot of great talks so far this whole week. And I've had the pleasure of being able to attend some. And some I missed, unfortunately, so hopefully I'll get to see them later online. And really a lot of times when we're a beginning programmer, we sort of start hello world
and then we just jump right to this world of doing AI and machine learning. And we think we can instantly do everything. And it's good to have, you know, the gumption to do that. But really, it's good to understand some of the basics behind it and what it is.
So, I'm going to cover some information here. And I'm going to talk about AI, ML, and deep learning. And where it comes from and where we go. And then some tools to help you. And then the more important thing is I'm going to show it in action. So, I'm going to try to get through the slides first and then show some code. And hopefully you all like it.
So, artificial intelligence is an umbrella term that started in the 1950s. And AI, deep learning, and machine learning are all subsets of artificial intelligence. And really back then when artificial intelligence first started, they were doing things like playing chess. And, you know, they were doing some computational things. But it was more, you know, the computational power really wasn't there.
Or the hardware or the software. We had the algorithms, but they were still slow overall. And as time goes on, we get to the, like, 80s to the 2010s. And that's when machine learning starts, really starts taking off. And here we're going to use algorithms to find patterns within our data. And we're going to use, take these models,
and we're going to make predictions off of information that we had in the past. And then we get to today, the 2010s. And beyond. And we're getting to deep learning. And this is where they introduced the idea of neural networks. And multilayers with hidden layers. And you're mimicking the brain on how information can get from one end to the other.
And we sort of, sometimes people feel like it's a black box of how information goes in and an answer comes out. But that's okay. So traditional machine learning namespaces follow things like retail and market and healthcare. And even finance. And here we, you know, you have things where you're doing market segmentation with retail.
And then you have fraud detection, both in the financial and healthcare world. But also there's a whole geospatial component that sort of fits in with all that. One, one of my favorite open source sayings is spatial's not special. And it applies with machine and deep learning as well.
So traditionally, we have two types of machine learning that you see. You have supervised and unsupervised. And with supervised, you know, you have your classifications working on labeled data. And these are things like random forests and your regression. So you have your linear and logistic regression.
And you have unsupervised. And these are things that you see a lot. And that's k-means clustering, dbscan. You can even use unsupervised for dimension reduction. So if you have lots of data, lots of columns, sometimes you need to reduce it down. And you can use PCA and SVD. So deep learning, the goal of deep learning and the focus of really where we're trying to get
is that deep learning is trying to mimic the human brain. And I mentioned that before. And, and it's going to follow some common, and it has some common algorithms that you might have heard when reading things on the internet. And you have your neural networks, your deep belief networks, your recurrent neural networks. And it's going to try to learn the best you can.
I was talking to somebody earlier today. And I was trying to create an analogy about this. And it was, I was using my daughter when she was first born. And it's sort of like, every time you train data and you run it in epoch, it's sort of like teaching them a new word. So, you know, they make a sound.
And you say, no, it's more like this, you know. And you keep going. And you get better results as you go along. But it's really sort of like that. You can, even though it's more complex mathematically and everything, and maybe it isn't for a child learning to words, it really, that's how it is. It's like training somebody who doesn't know yet. And we're going to use algorithms to look at huge, vast amounts of data.
And we're going to take that and then take actions or perform some function based on the derived information. So learning steps are pretty simple and at a high level. But we have data.
And we hope it contains a pattern or we want it to contain a pattern. So we're going to look for it. And we're going to train our data using some model to be named yet. And you're going to iterate over it multiple times. And let's assume we find a pattern with our data. So that means we can recognize that pattern so we have what's called a model.
You then take this information with new data and you're going to use your model and you're going to derive new predictions out of that. So that's the general learning steps that we're going to follow at a very, very high level. And these learning steps can be applied to computer vision on geospatial imagery. And we're going to focus on two types.
Object detection. So we're going to look for something that we want to find and draw a bounding box around it. Or you can do pixel classification. And this is where you take every pixel within an image and assign it some sort of class. Whether it's a letter or a number and you generalize it. So here we have what's called a single shot detector.
And the basic idea is that we're going to have one network that we're going to go for because we want it for speed. And we're going to try to find bounding boxes around it. And the image on the upper left hand side, you can see with the dog, the bicycle, and the car is the goal. So we're going to basically say that's a dog.
We're going to draw it in one and a bicycle and identify and just put. We're not actually going to take the full image and the boundary on it. We're just going to say this is that and this is something else. But to apply it to a geospatial problem, you can take it a problem like pool detection or finding oil pads and just drawing the bounding box around that.
We can also use, for our pixel classification, we can use UNET. And with UNET, we're going to do semantic segmentation. And one of the advantages of using UNET is that it's computationally efficient. And you can train it on very small data sets. And the goal here, if you recall the previous bike example that we had with the dog and
the bike and the car, we were just drawing bounding boxes. But now you're actually taking the area where that thing exists and assigning all those pixels within that area, that specific class. So a lot of you, I've heard, are doing land use, land cover.
This is a great way of doing that. It's computationally efficient and you can use existing land use cover data sets to apply it. But some other applications of doing this are, especially the autonomous vehicle driving, you can use for semantic segmentation, medical imaging diagnostics for finding cancer within
patients, precision agriculture, finding areas that need to be improved, maybe looking at moisture, things like that. And then we have land use, land cover classification, which is a traditional GIS problem. Now the ArcGIS is a platform built for deep learning, especially the ArcGIS API for Python.
And it's going to help you with your deep learning workflows and still give you the ability to pick the backbone that you use to do those. It's going to give you tools to help you prepare your data and create the labels that you need, train your models, and do model deployment so you can share with your colleagues around the world.
So if you want the GUI approach, you can use ArcGIS Pro along with Image Server to perform the deep learning. But if you're like me, I prefer to do via command line, you can use the ArcGIS API for Python. And you can do all these steps. So the ArcGIS API for Python is where we're going to focus our demos on.
And the ArcGIS API Python is a free piece of software that anybody can download and install. And there's two ways to install it. If you don't have ArcGIS Pro, you can do conda install and then put in the Esri repository and the package. Or you can use pip install ArcGIS.
And the ArcGIS API does more than just learning. It also contains a whole bunch of ways to do geoprocessing, other raster analytics, both in memory and through services. It has a space-enabled data frame. It does geoenrichment, geocoding, all the things you sort of expect from a standard
GIS library, it does. On top of that, you can also do rich visualizations with it. So like I said before, installation's easy. It's a little easier to see on this slide. You can use condas or pip. But we're going to focus on ArcGIS Learn.
And inside the ArcGIS API for Python, as analysts or geospatial data scientists, you can apply your deep learning workflows quite easily. And the whole idea is a lot of packages out there, they all do deep learning and machine learning,
but they have different interfaces as you use different like Keras and other ones. So we took and standardized the inputs so it's the same experience, regardless of what you want to use to power your learning. And the module's going to include methods to export training data, do the data preparation, model training, et cetera.
So let's take a look at some examples of doing this. We're going to start out by first doing some unsupervised clustering. So here we have, we're going to use, in the United States, there's this data set called the wind turbine data set.
And it provides all the locations of the data sets that are both onshore and offshore. And we're going to see how they cluster together. And we're going to use K-means algorithm to detect our clustering mean algorithm. And we're going to leverage scikit-learn, and we're going to use the spatial enable data frame to do that,
which is a pandas data frame with spatial capabilities. And we're going to group our data using similarity and focusing on the the lat long of the locations of our data set. So for those who don't know, if you have data that's just point data sitting out there,
whether it's actual geographic data or just two coordinates, or that could look like this, the, oh, it didn't switch over. Thank you, PowerPoint. Somebody should have said, hey, you messed up.
Sorry, I was going through code as I was talking. So we want to measure the similarities between objects and what we're going to do for lat long. And we can calculate our K-means by using scikit-learn
and passing in the number of clusters that we want and protecting our data. So we had locations that look like this. Now visually, you can see that there's most likely three groupings together. But we can show it by using Euclidean distance and the sum square errors for inertia. And we're going to pass it in, get our labels, apply it,
and we get back our clustering along with our centroids. So now getting back to our data, that's a quick two-second brief approach on K-means. So we're going to load in our spatially enabled data. In this case, it's coming from a shapefile that was provided by the US government. And we have our various locations. So we have both our data along with our geometry.
We can then go through and start calculating the number of clusters. We can use the elbow method to determine a number of clusters with K-means. And in this case, I'm going to take this and I'm just going to do four for the sake of the demo. Go through and calculate our number of clusters,
run the analysis, and display the results on the map. Sorry, I jumped through that, but I'm running out of time. So the next thing I want to talk about is doing another machine learning technique and focusing on random forest. And so before we had a unsupervised method.
In this method, we're going to use supervised method. And for those who don't know, and who might not be in the world, the importance of seagrass is, seagrass is like the rain forest of the ocean. And they're disappearing on the surface like much of our green space on land. And it provides an area for shelter for fish
and other wildlife within the ocean. And it also is a key important part for sea towns where economic and where it affects local economies. So if they disappear, not only do you affect the wildlife, but the people that live in the area will also be out of work
and possibly famine and other impacts. So how can we figure out where, how can we predict where there should be seagrass based on known locations? So we're going to load our data in, and this time I'm going to pull it down from a web service hosted out by Esri as a feature layer
and then convert it to a spatially enabled data frame. And then just so you understand what it is, we have a bunch of columns like the number of O2 nitrate concentrations and things like that. And those are going to be, we're going to use those as our information to do the, make a prediction,
help us predict our values. We're going to convert data from, to categorical to save some space on memory because categorical data is, if you have in pandas, categorical data is very memory efficient. And then we're going to evaluate to see the correlation between our predictors. This is just one way of visualizing it.
I'm going to create my training and test data. I'm going to split it up. So my test size is going to be 15% of my data. So we have a test size is 15, training size is 15, test is 85,000. We're going to create our classifier.
So we're going to use the random forest classifier in this case. And we're going to go ahead and fit our data to it. Once you've done that, you can then determine which variables are actually important. And notice three variables that we picked, C2, C1, and C3 aren't very important.
So we could drop them, but I'm not just right now. We're then going to, you can go ahead and make a prediction on our test data that we had, the 15% we had before. We're going to calculate and then we can go ahead and calculate our accuracy with what we predicted. After we do the calculation, our model, you can see that we only had accuracy of 61.4%.
And so we didn't do fairly well. So we want to go back and reassess what we found and reapply and maybe either modify the values we use to predict our locations of if seagrass should be there or not. But that's just an example of using random forest.
All right, so now I want to get to deep learning, which is the other side of what we're going to do. And two minutes, okay. So I'm going to talk about it very, very fast. So what you have when you do deep learning within the ArcGIS platform is that you have your training data and imagery. And this can come from both services, local data,
or hosted on ArcGIS Online or other publicly available data sources. We've done it with even WMS as well. So if you have OGC, WST. So it first starts by creating your training your data model. And that's just done by exporting your data. And this is going to help us create
the information that we need and so we can do our classifying. So once we export our data based on the area or samples, we're then going to go through and train our unit algorithm because we're going to be doing that pixel classification. So we can start. I'm doing this on a server.
So I'm going to, I set my data path where I want everything to go and I'm going to prepare my data. I specify the batch sizes and once that's completed, I can then look at my data bunches. Now we can go ahead and create our classifier and we have to determine our learning rate and we have a tool to help you.
So it's based on fast AI and it's our learning rate finder. So there's general rules. So the learning rate finder, for those who don't know, plots the learn rate versus the loss relationship for the learner. And it's going to help you reduce the guesswork to predict a good starting point. So first you run the LR find function
that we have built in and then we're going to examine the plot. You examine the plot like we have here and then you pick the learning rate before it diverges to start the training. So here we're going to do e to the negative four. Because UNET's very efficient, you don't have to train it very much. Well, I'm not going to train it much here. So I'm only going to train it 10,
I only trained it 10 times and you can display the results. So you have truth versus prediction and you can see already that we missed some, I only trained it very little and had a very little test data because I just wanted to run it really fast. So we have our, like we missed water and some buildings,
but that's okay. This is just to show the actual purpose of what's going on. And if we're happy with our data, we can persist it to disk and share it out. So it initially saves to a zip file or you can save it out, for example, to a portal on ArcGIS Online so you can share with your other colleagues. You can then, once you have a model,
you can then re-consume it and train it on your other data. So if you remember our learning pattern that we followed, we had existing data, we trained it, so we've done that so far and then we developed the model because we found a pattern. Now we're going to take this model and we're going to load it and install it and we're going to use it on new data to make a prediction. So we load it in
and then we call classify pixels on our new set of imagery. It takes some time to run, so it took about a minute for the area that I'm doing and it made a classification here. this wasn't a very good model,
it's just to show how easy the actual workflow is and how you don't need to do a lot of classification to do that. What you would do next is you would probably add more training data and re-optimize your parameters for going in. And train your data more in order to get a better prediction. But in a few lines of code, if you didn't break it up,
you could have a complete land use land cover case of showing that without actually having somebody out in the field like you would traditionally do with land use land cover or using other techniques as well. So I believe I'm out of time. So you said two minutes. So thank you. I have another demo
if anybody wants to show which is doing single shot detector and using that to find bounding box around the data. We can go offline after we're done. But I'd like to take some questions before we run out of time. So got to stay on the formula.
No, maybe not. I've been kicked out. Okay, any questions? Yes, sir.
Am I right in thinking that the single shot detector is a single pass one that's commonly used for video more real-time stuff as well? It doesn't have to be used with video. You can do it with static imagery. Okay. But it's a single pass? Single pass at the image. Right, okay.
That's what makes it fast. I mean, relatively fast. Depending on the area you're doing. Well, thank you.