<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/deep-learning-in-satellite-imagery/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://appsilon.com/deep-learning-in-satellite-imagery/"> r – Appsilon Data Science | End­ to­ End Data Science Solutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div><img width="1" src="https://www.google-analytics.com/collect?v=1&tid=UA-46680230-1&cid=*%7CUNIQID%7C*&t=event&ec=repost&ea=open&cm=reposting&cn=Deep%20learning%20in%20Satellite%20imagery" height="1/"></div>
<p>In this article, I hope to inspire you to start exploring satellite imagery datasets. Recently, this technology has gained huge momentum, and we are finding that new possibilities arise when we use satellite image analysis. Satellite data changes the game because it allows us to gather new information that is not readily available to businesses.</p>
<h2>Why are satellite images a unique data source? What is currently available, and what properties do you have to take into account when choosing which images to use?</h2>
<p>Satellite images allow you to view Earth from a broader perspective. You can point to any location on Earth and get the latest satellite images of that area. Also, this information is easy to access. There are free sources that allow you to download the mapped image onto your computer, and then, you can play with it locally.</p>
<p>One of the most important aspects of using satellite images is that you can also browse past images of certain locations. This means that you can track how the area changed over time and predict how it will change in the future. All you have to do is define the properties that are relevant to your use case.</p>
<p>To give you an idea of how satellites track our progress on Earth, we have to take a look at what is above us.</p>
<div class="wp-caption"><img sizes="(max-width: 1920px) 100vw, 1920px" src="https://i2.wp.com/appsilon.com/assets/uploads/2018/12/satellites_all.png?w=450&ssl=1" alt="Satellites around the globe" class="wp-image-1536" data-recalc-dims="1">
<p class="wp-caption-text">Source: European Space Agency</p>
</div>
<p>There are currently over 45 hundred satellites orbiting the Earth. Some are used for communication or GPS, but over 600 of them are regularly taking pictures of the Earth’s surface. Currently (as of end of 2018), the best available resolution is 25cm per pixel, which means that 1 pixel covers a square of 25cm x 25cm. This translates to a person taking about 3 pixels on an image.</p>
<p>The current technology we have actually allows us to get an even better resolution, but it is not available, as many governments don’t allow us to take more detailed images due to <a rel="nofollow" href="https://www.nbcnews.com/science/space/digital-globes-satellite-pics-push-legal-limit-n313026" target="_blank">security reasons</a>. Meaning, you won’t be able to access better quality unless you have security clearance.</p>
<h3>Available sources of satellite images</h3>
<p>The first group is <strong>free public images</strong>. Amongst them are American <a rel="nofollow" href="https://landsat.usgs.gov/" target="_blank">Landsat</a> and European <a rel="nofollow" href="https://sentinel.esa.int/web/sentinel/home" target="_blank">Sentinel</a>, which are the most popular free images. Landsat will provide you images with a resolution of 30m per pixel every 14 days for any location. Sentinel will provide images with a resolution of 10m per pixel every 7 days.</p>
<p>There are also <strong>commercial providers</strong>, like <a rel="nofollow" href="https://www.digitalglobe.com/" target="_blank">DigitalGlobe</a>, that can provide you with images with a resolution up to 25cm per pixel where images are available twice a day. It is important to strike a balance between the different properties that you need, as the best resolution doesn’t always mean that you get the most frequent images.</p>
<p>Also, cost is an important factor. The best images can cost up to a couple hundred dollars so it is wise to start building your solution with lower quality images. Just make sure you use the best ones for your particular use cases. Of course, commercial sources offer subscriptions, which will reduce the images’ cost.<br>
<img sizes="(max-width: 1920px) 100vw, 1920px" src="https://i2.wp.com/dev.appsilon.com/assets/uploads/2018/12/spatial_resolution_availability.png?w=450&ssl=1" alt="spatial resolution availability" class="wp-image-1537" data-recalc-dims="1"></p>
<h2>Properties of satellite images</h2>
<p>Let’s go through the properties that you have to balance out when choosing an image source. First is <strong><a rel="nofollow" href="https://en.wikipedia.org/wiki/Image_resolution#Spatial_resolution" target="_blank">spatial resolution</a></strong>. As you can see, technology has been rapidly advancing, and there is more and more money being invested into launching better satellites and making them available.</p>
<p>The second factor is <strong>temporal resolution</strong>. This is how often you get a picture of a given place. This is an important aspect because of how clouds may block your point of interest. For example, if you only get 1 image every 7 days, and your location is in a cloudy area, then it is likely all your images in a month might be blocked by clouds, which stops you from collecting data in your area. There are some algorithms being created to mitigate this issue, however, it is still a big problem when browsing images. For the most part, it is better to get the highest possible frequency to improve your chances of getting a clean shot of the given area in the selected time frame.</p>
<p>Now, the third factor is interesting. It is <strong>spectral resolution</strong>. When you think about an image, you usually think of three layers: red, green, and blue; these layers compose a visual image of the area. This is because our human eye has three color-sensitive cones, which react to red, green, and blue.</p>
<p><img sizes="(max-width: 3358px) 100vw, 3358px" src="https://i0.wp.com/dev.appsilon.com/assets/uploads/2018/12/temporal_vs_spectral_resolution.png?w=450&ssl=1" alt="temporal vs spectral resolution" class="wp-image-1538" data-recalc-dims="1"></p>
<h3>Satellites offer more than RGB photos</h3>
<p>However, satellites can have many more sensors that allow them to record spectrums that our human eyes cannot see. An image taken by the satellite can have 12 or more layers, and each layer brings more information. By combining the layers, you can create indicators that will give you additional insight about what is happening on the ground.</p>
<p><img sizes="(max-width: 1278px) 100vw, 1278px" src="https://i0.wp.com/dev.appsilon.com/assets/uploads/2018/12/radar.png?w=450&ssl=1" alt="Radar image" class="wp-image-1539" data-recalc-dims="1"></p>
<p>One fascinating indicator is the normalized difference vegetation index (<a rel="nofollow" href="https://en.wikipedia.org/wiki/Normalized_difference_vegetation_index" target="_blank">NDVI</a>), which can be used to estimate the condition of the plants. When you look at a normal picture of a field, you see different shades of green, but it doesn’t tell you how healthy the vegetation is.</p>
<p>We can measure vegetation health by looking at the near-infrared light that gets reflected from flora in different ways depending on the amount of chlorophyll. This allows us to see how healthy the plants in our observation area are, which is not possible to derive from an RGB image.</p>
<p>Another example is soil moisture, meaning how wet the land is. During droughts, like in LA, authorities introduced water restrictions. It turned out that <a rel="nofollow" href="https://www.revealnews.org/article/who-is-the-wet-prince-of-bel-air-here-are-the-likely-culprits/" target="_blank">wealthier individuals didn’t follow these restrictions</a> and continued to use large amounts of water. Thanks to satellite images, the government could see which fields had high soil moisture, helping them to better enforce these water restriction laws.</p>
<p>It is, also, worth mentioning that there is radar technology that allows you to see through the clouds, but it won’t fit every use case you may want to apply it to.</p>
<p>The current, state-of-the-art satellites have 25cm resolution or images twice a day. This is an example of a standard image.</p>
<div class="wp-caption"><img sizes="(max-width: 1332px) 100vw, 1332px" src="https://i1.wp.com/appsilon.com/assets/uploads/2018/12/sydney_beach.jpg?w=450&ssl=1" alt="Sydney Beach" class="wp-image-1554" data-recalc-dims="1">
<p class="wp-caption-text">Sydney Beach by DigitalGlobe</p>
</div>
<p>Clearly, you can see people, and you can even count the number of tables outside the restaurant.</p>
<p>As I said before, you have to strike a good balance between these properties to serve your problem. Spatial resolution may not be the most important factor in your research. You also need to consider the temporal and spectral resolutions, cost, availability, and ease of processing.</p>
<h2>How can we leverage this data source in our R projects?</h2>
<p>Let’s start with what shouldn’t be done in R. There are two main categories: <strong>data pre-processing </strong>and <strong>resource intensive operations</strong>. One image will weigh around 1GB and will cover a large area, like half of the state of Washington.</p>
<p>Downloading 100 images and cutting them on your computer is very resource intensive and shouldn’t be done locally in R. There are platforms available that will do the pre-processing and send you the small cut outs of the shapefile that you want. Amongst them, there is <a rel="nofollow" href="https://earthengine.google.com/" target="_blank">Google Earth Engine</a> and Amazon Web Services (AWS), which allow you to simply query the API. They already have public image sets available, and you can upload your own image sets. All of this is available at your fingertips. You just say, “Google, I want a set of dates for Sentinel images that cover small square containing Loews Hotel,” and you are set. From there, you choose one or more dates and ask the API to send you already cropped images, reducing the image size by hundreds of kilobytes.</p>
<p>This all happens quite quickly, as you’re using huge distributed infrastructure to do the calculations. In addition, you can actually conduct computations there and receive indicators. For example, you can receive the NDVI indicator, which is a simple, mathematical combination of the near-infrared and red channels.</p>
<h3>R Shiny dashboards for satellite imaginary</h3>
<p>Now, R shines when you build dashboards to present the data. You can analyze and forecast the indicators that you’ve built. Operating on small images allows you to leverage many useful R packages to experiment with this data and gain valuable insight. Of course, you can also build neural networks that will help you indicate objects on these images.</p>
<p>Here is an example of a dashboard that you could build with R.</p>
<p><img sizes="(max-width: 936px) 100vw, 936px" src="https://i0.wp.com/appsilon.com/assets/uploads/2018/12/dashboard_crop_fixed-1.png?w=450&ssl=1" alt="" class="wp-image-1560" data-recalc-dims="1"></p>
<p>By combining publicly available geospatial data for parcel shapefiles, you can draw any parcel on a map and request available dates of images for that parcel. Then, you can analyze the image, indicate where crops are destroyed, or where they are unhealthy.</p>
<p>This is an example of visualizing an NDVI indicator.</p>
<h3><img sizes="(max-width: 520px) 100vw, 520px" src="https://i2.wp.com/dev.appsilon.com/assets/uploads/2018/12/ndvi.png?w=450&ssl=1" alt="ndvi" class="wp-image-1542" data-recalc-dims="1"></h3>
<p>As seen above, there are sub-areas with healthy crops, while there are others with unhealthy plants. Also, the clouds here are distorting the results, which should be accounted for.</p>
<p>One example of applying deep learning to the pre-processed images that I can share is one where we <a rel="nofollow" href="https://appsilon.com/ship-recognition-in-satellite-imagery-part-i/" target="_blank">used Kaggle data to indicate if there was a ship located in an image</a>. If you don’t have such a data set available, you have to combine other data sources.<br>
<img sizes="(max-width: 637px) 100vw, 637px" src="https://i1.wp.com/dev.appsilon.com/assets/uploads/2018/12/ships.png?w=450&ssl=1" alt="" class="wp-image-1543" data-recalc-dims="1"></p>
<p>We can use a system called AIS, it requires ships to report their positions on a regular basis. From there, we got a satellite image of the sea, combined that with the ship positions at that time, and cut out the images to prepare the data set.</p>
<p>In the maritime industry, it is important to know where ships are, as there are some restricted areas. For example, there are areas where it is forbidden for fisherman to catch fish. Some of them would turn their AIS off and go there to catch fish. Scanning the satellite images allows us to identify some of these illegal acts.</p>
<p>Also, R is great to augment your data set and produce even more examples.</p>
<p>Here is the network that we used to identify these ships.</p>
<p><img sizes="(max-width: 1166px) 100vw, 1166px" src="https://i2.wp.com/dev.appsilon.com/assets/uploads/2018/12/network.png?w=450&ssl=1" alt="" class="wp-image-1544" data-recalc-dims="1"></p>
<p>It consists of two convolution layers, one max pooling, two <a rel="nofollow" href="https://appsilon.com/object-detection-yolo-algorithm/" target="_blank">convolution layers</a>, max pooling again, and then a softmax function. We also use a dropout to avoid overfitting. Using Keras simplifies the process of defining a network like this.</p>
<p>In this problem, we achieved 98% accuracy, and if you’re interested in the details, you can check out <a rel="nofollow" href="https://appsilon.com/ship-recognition-in-satellite-imagery-part-i/" target="_blank">this article on our blog</a> by Michał Maj.</p>
<h2>The architecture of complete satellite imagery solution</h2>
<p>Now, let’s break down a full architecture of a solution that you could build to analyze satellite images and present the results.</p>
<p>First of all, you need a data source. It can be either a platform or you can get them from providers.</p>
<p>You have to pre-process them, and you need large resources here so it is useful to either build your own solution in cloud or leverage existing platforms. You can batch process many images at once and store them. You can also use an API to get the pre-processed images on demand.</p>
<p>With the prepared images, you can train your network and save the model. Then, you can run a batch process to label your images and store them. Finally, you can build a dashboard that will use them or use the API to request an image, run the model on it, and present results.</p>
<p>Although presented architecture is based on R &amp; Shiny, Python is suited for this job as well and we tested it in our commercial projects.<br>
<img sizes="(max-width: 1920px) 100vw, 1920px" src="https://i1.wp.com/dev.appsilon.com/assets/uploads/2018/12/architecture.png?w=450&ssl=1" alt="Architecture of complete solution SATELLITE IMAGERY + R" class="wp-image-1546" data-recalc-dims="1"></p>
<h2>Business applications of satellite imagery</h2>
<p>Let’s look at some emerging applications in different business areas. These are just some examples, but we are seeing more and more different use cases each day.</p>
<p>First is <strong>agriculture</strong>. Farmers can have a live overview of their crops that show their crops’ health and damages. Using this technology, they can quickly estimate their losses after drought, flood or hurricane. Recently is also used in fertilizing process.</p>
<p>Second is <strong>real estate</strong>. For example, construction companies can use this technology to see what their competition is doing and benchmark their performance comparatively. Further, they can see which areas are expanding to know what locations might be good to invest in. Also, rooftops themselves provide information about the state of a given building, which is valuable to builders.</p>
<p>The third is <strong>finance and insurance</strong>. Traders can forecast the supply of goods based on the number of containers being delivered from particular areas. This gives them a huge advantage. For example, they can predict that the price of the given goods will rise in the future if there is a supply shortage. With better spatial and temporal resolutions, you can learn more details about an area. For example, you can use this technology to identify cars in different neighborhoods and assess if an area is wealthy. There were even use cases where the <a rel="nofollow" href="https://orbitalinsight.com/" target="_blank">companies</a> count the number of cars in a parking lot to see how well a given supermarket was doing. Note that for this type of work, you need to use much more frequent data.</p>
<p><img sizes="(max-width: 2417px) 100vw, 2417px" src="https://i2.wp.com/dev.appsilon.com/assets/uploads/2018/12/business_vis.jpg?w=450&ssl=1" alt="satellite usage in business" class="wp-image-1547" data-recalc-dims="1"></p>
<h2>Summary</h2>
<p>The technology is getting better and better. If you start experimenting with these images now, you will be on top of this wave soon. It is important to realize that these techniques are technology agnostic, meaning they don’t only apply to satellite pictures.</p>
<p>In the future, it might be possible to even apply these techniques to live drones or airships. The industry is on the rise, and if you start soon, you can get big returns in the future. Use images, share your results with the community, and, most importantly, have fun. Playing with these images, while valuable, is also very exciting.</p>
<p>Artykuł <a rel="nofollow" href="https://appsilon.com/deep-learning-in-satellite-imagery/" target="_blank">Deep learning in Satellite imagery</a> pochodzi z serwisu <a rel="nofollow" href="https://appsilon.com/" target="_blank">Appsilon Data Science | End­ to­ End Data Science Solutions</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://appsilon.com/deep-learning-in-satellite-imagery/"> r – Appsilon Data Science | End­ to­ End Data Science Solutions</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/FEcn25Kk5no" height="1"></a></div>