Mars and Earth similar landscape​
​by Daniel Carvalho
Basically every day there are NASA Perseverance Mars Rover new images from Mars, kindly shared and published.
And of course we can compute it and do some data science on it.
I am wondering where are those places on Earth that seams to be like Mars landscape?
We can get a NASA published Mars rover image and use against geo location neural network and figure it out!
Image source:
https://mars.nasa.gov/news/8963/nasas-perseverance-rover-begins-its-first-science-campaign-on-mars/
First, get one Mars image from NASA website, I just did a copy, past to my notebook:
In[]:=
marsImg=
;
In[]:=
Information[marsImg]
Out[]=
Image
Color Space
RGB
Image Dimensions
{1600,1186}
Image Resolution
{96.012,96.012}
Channels
3
Interleaving
True
Transparency
False
Data Type
Byte
In[]:=
ImageDimensions[marsImg]
Out[]=
{1600,1186}
Reduce image size for this example. But in research it is good to work with the full image resolution...
In[]:=
marsImg=ImageResize[marsImg,600]
Out[]=
In[]:=
ImageDimensions[marsImg]
Out[]=
{600,445}
Now import a ready to use neural network from Wolfram Neural Network Repository that can give as a geo location based in a photo:
In[]:=
locationNn=NetModel["ResNet-101 Trained on YFCC100m Geotagged Data"]
Out[]=
NetChain
Input
image
array(size: 3×224×224)
bn_data
BatchNormalizationLayer
array(size: 3×224×224)
conv0
ConvolutionLayer
array(size: 64×112×112)
bn0
BatchNormalizationLayer
array(size: 64×112×112)
relu0
Ramp
array(size: 64×112×112)
pooling0
PoolingLayer
array(size: 64×56×56)
stage1_unit1
NetGraph (11 nodes)
array(size: 256×56×56)
stage1_unit2
NetGraph (10 nodes)
array(size: 256×56×56)
stage1_unit3
NetGraph (10 nodes)
array(size: 256×56×56)
stage2_unit1
NetGraph (11 nodes)
array(size: 512×28×28)
stage2_unit2
NetGraph (10 nodes)
array(size: 512×28×28)
stage2_unit3
NetGraph (10 nodes)
array(size: 512×28×28)
stage2_unit4
NetGraph (10 nodes)
array(size: 512×28×28)
stage3_unit1
NetGraph (11 nodes)
array(size: 1024×14×14)
stage3_unit2
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit3
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit4
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit5
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit6
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit7
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit8
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit9
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit10
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit11
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit12
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit13
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit14
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit15
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit16
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit17
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit18
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit19
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit20
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit21
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit22
NetGraph (10 nodes)
array(size: 1024×14×14)
stage3_unit23
NetGraph (10 nodes)
array(size: 1024×14×14)
stage4_unit1
NetGraph (11 nodes)
array(size: 2048×7×7)
stage4_unit2
NetGraph (10 nodes)
array(size: 2048×7×7)
stage4_unit3
NetGraph (10 nodes)
array(size: 2048×7×7)
bn1
BatchNormalizationLayer
array(size: 2048×7×7)
relu1
Ramp
array(size: 2048×7×7)
pool1
AggregationLayer
vector(size: 2048)
fc1
LinearLayer
vector(size: 15527)
softmax_softmax
SoftmaxLayer
vector(size: 15527)
Output
class

Use Mars image as input and check the geo location on Earth
In[]:=
position=locationnn[marsImg]
Out[]=
GeoPosition[{31.1058,8.48245}]
Visualize the area with this geo location (latitude, longitude):
In[]:=
GeoGraphics[position]
Out[]=
Well it is in a desert, distant from urban areas...
Lets take a closer look...
GeoGraphicsGeoDiskposition,

Out[]=
Well it does not tell much where it is...
Lets zoom out...
In[]:=
GeoGraphicsGeoDiskposition,
,GeoRangeQuantity[10,"Kilometers"]
Out[]=
Zoom out more, geo disk about 100km and geo range of 1000km:
OK, lest zoom out more...
Now we can check more probable landscapes on Earth that is similar to Mars according the image given...
For another test, we can view the Mars image as black and white.
And we can try to colorize it artificially with a neural network too trained with Earth images.
This function convert the neural network output data back in a image, this source code is available at the repository too:
Now lest see side by side the original Mars image, the grey scale and the artificially colored image:
Of course a dessert landscape on Earth probably would have a beautiful clean blue sky, the ground is really close from the original Mars image.
Lest see where this artificial colored Mars image can be seen on Earth:
We can check some info about this neural network we are using to get geo location from an given image:
Another visualization, with colored dots at each geo location, hue color adjusted as the probabilities:
Reference:
https://resources.wolframcloud.com/NeuralNetRepository/