At first glance the apparently barren expanses of the Sahel and Sahara deserts feature little greenery, but detailed satellite imagery combined with computer deep learning has revealed a different picture.
In fact, some 1.8 billion trees dot parts of the West African Sahara and Sahel deserts and so-called sub-humid zone, a previously uncounted bounty that overturns previous assumptions about such habitats, researchers say.
"We were very surprised that there are quite (so) many trees growing in the Sahara desert," lead author Martin Brandt told AFP.
"Certainly there are vast areas without any trees, but there are still areas with a high tree density, and even between the sandy dunes there are here and there some trees growing," added Brandt, an assistant professor of geography at the University of Copenhagen.
The survey provides researchers and conservationists with data that could help guide efforts to fight deforestation and more accurately measure carbon storage on land.
"For preservation, restoration, climate change and so on, data like this are very important to establish a baseline," said Jesse Meyer, a programmer at NASA's Goddard Space Flight Center who worked on the research.
"In a year or two or ten, the study could be repeated… to see if efforts to revitalise and reduce deforestation are effective or not," he said in a NASA press release.
Finding and counting the trees was no simple task. In areas with plenty of trees, thick clumps of growth appear relatively clearly in satellite images, even at low resolution, and are easily distinguishable from bare land.
But where they are more spread out, satellite imagery can be too low-resolution to pick out individual trees or even small groups.
Higher resolution imagery is now available, but even then problems remain: counting individual trees, particularly over vast areas of territory is an almost impossible task.
Brandt and his team came up with a solution, pairing satellite images at very high resolutions with deep learning - essentially training a computer programme to do the work for them.
But that didn't mean they could just sit back and wait for the results.
Before the deep learning programme could get to work, it had to be trained, an onerous process that saw Brandt individually count and label nearly 90,000 trees himself. It took him a year.
"The level of detail is very high and the model needs to know how all kind of different trees in different landscapes look," he said.
"I did not accept misclassifications and further added training when I saw wrongly classified trees."
Setting a conservation baseline
It was worth the effort, he said, allowing what would have taken millions of people years of work to be computed in just hours.
"Other studies are based on estimations and extrapolations, here we directly see and count each tree, it is the first wall-to-wall assessment."
The survey, published Wednesday in the journal Nature, covered an area spanning 1.3 million square kilometres (around 500,000 square miles) and involved analysis of more than 11,000 images.
The technique suggests "it will soon be possible, with certain limitations, to map the location and size of every tree worldwide", wrote Niall P. Hanan and Julius Anchang of New Mexico State University's Plant and Environmental Sciences Department, in a review of the research.
And accurate information on vegetation in deserts and other arid zones is "fundamental to our understanding of global-scale ecology, biogeography and the biogeochemical cycles of carbon, water and other nutrients," they wrote in the review commissioned by Nature.
Better information may help determine how much carbon is being stored in these sites, which are not usually included in climate models, Brandt said.
But it's too early to say whether having an accurate count of this tree life will affect how we understand climate change and its acceleration, he added.
He hopes now to use the technique elsewhere, to map more previously hidden trees in the 65 million square kilometres (25 million square miles) of arid regions in the world.