Random Forests and Living Trees

This article is a translation of the original article published on September 3, 2017. You can read the original (in Ukrainian) here. The article’s title is a play on words in Ukrainian, referring to the “Random Forest” algorithm and the random occurrence of dense forest areas in the locality.

Within Kryvyi Rih, 22 thousand hectares are covered by well-developed woody vegetation: parks, squares, residential areas, shelterbelts, and unorganized thickets. This constitutes approximately 46% of the city’s total area! Adding areas with grass vegetation brings the total green space coverage to 71% of Kryvyi Rih.

Despite the current policy of total “rejuvenation” of trees in residential and park areas, often leading to tree death, the overall “greenness” of Kryvyi Rih is impressive! This is achieved through several components. The largest contribution comes from urban parks, squares, and shelterbelt plantations. However, unorganized wild plantations, private residential areas, and dacha cooperatives contribute significantly. These components ensure a high level of tree planting and somewhat prevent the rapid destruction of woody vegetation.

Regarding other components of Kryvyi Rih’s plant ecosystem, the area of territories with any vegetation is also quite large. The total area of territories with grass vegetation is approximately 12 thousand hectares, accounting for 25% of the city’s total area. This includes lawns, wastelands, and bulrush thickets.

Therefore, we can state that 71% of Kryvyi Rih’s territory is covered by grass and trees, with a relatively high density of vegetation cover. Only 29% of the territory remains uncovered by vegetation: quarries, dumps, industrial sites, major roads, roofs of high-rise buildings, and water surfaces.

My research not only confirmed the huge recreational and general ecological potential of Kryvyi Rih’s green zones but also, unfortunately, noted the extremely neglected state of urban areas. Particularly distressing is the ubiquitous litter! While researching, I encountered piles of household and construction debris everywhere! Even in impenetrable thickets, one finds beer cans, torn rags, and worn shoes! It goes without saying about areas with unobstructed pedestrian access. Not to mention the “wild” dumps created by residents.

To calculate the total area of territories with different types of cover, I identified 9 conditional classes of urban area cover. Specific plots within Kryvyi Rih were chosen as reference sites for these classes. Since my research focused on determining plant cover, I did not examine the “uninteresting” non-vegetated areas in detail. Anything nearly devoid of vegetation was recorded in the “Solid Surface” or the “Water” class.

Conditional Cover Class
Bulrush (Reeds) – dense bulrush thickets
Bulrush thickets on Hasanska Street

The boundary between water and bulrush. A pedestrian bridge over the Saksahan River near Galileo Street

The bulrush thickets. A pedestrian bridge over the Saksahan River near Diderot Street

The forest with dense bushes. Near the car bridge on Sicheslavska Street
Burned Area – areas of vegetation burned by firesNo photos were available. I relied on oral reports from city residents.
Forest – dense tree plantations with bushes and grasses
The with dense bushes. Near the car bridge on Sicheslavska Street

The forest with dense bushes. Near for the Fadeev Street

The meadow in the dense forest. Near the Nikopol Highway Street

The forest with dense bushes. Near the Nikopol Highway Street
Lawn – areas of low grass
The green lawn near the City council building

The stadium of General School is close to 66 Vokzalna Street

The withered lawn on the Ukrainska Street

Lawns in the square near Tambovska Street
Park – sparse tree plantations without bushes
Park near the former cinema “Druzhba”. Magistralna Street

Yuri Gagarin Park

Park near the former cinema “Druzhba”. Magistralna Street

Park with dense trees near the Museum of Labor Glory PrJSC “Pivnichny GZK” Cherkasova Street
Solid Surface – any hard surface: roads, concrete, bare soils, rock outcrops, industrial sites (quarries, dumps, etc.)
Hardcover near the City council building

Wasteland and buildings near Nikopol Highway

The road along Prorizna Street

The industrial zone around the “Pivnichny” quarry
Village – a dense mixture of trees, grasses, hard surfaces, buildings, and structures. Such a mix of heterogeneous objects within one pixel of a satellite image leads to specific reflection of both optical and radar waves. The most understandable representative of this class is single-story residential buildings, although areas of the “Village” class are also present in the yards of high-rise buildings.
Village on Nesterova Street

View of the village on Khersonska Street

Village on Tambovska Street

Village on Zaporizka Street
Wasteland – areas of tall grass with scattered trees
Wasteland near the pumping station on Galileo Street

Meadow between oak groves. Kershenska Street

Wasteland near the industrial site of the “Oktiabrska” mine. Fadeev Street

Abandoned stadium (?) near Fadeev Street
Water – any open water surfaces (rivers, ponds, reservoirs, etc.)
Saksahan River near Fadeev Street

Boundary between water and bulrush. Pedestrian bridge over the Saksahan River near Galileo Street

Saksahan River. Near the car bridge on Sicheslavska Street

View of the flooded quarry near Rubizhna Street

Based on the reference sites, I formed training and test samples for territory classification. The total number of reference sites is 1070, covering 25258 pixels of the satellite image (one-pixel size is 10×10 m).

Conditional Cover ClassTotal Number of Reference SitesTotal Number of Pixels in Reference Sites
Bulrush (Reeds)1242398
Burned Area42871
Forest1302671
Lawn871961
Park1813615
Solid Surface1244366
Village1263153
Wasteland1293049
Water1273444

I formed training and test samples from individual pixels within the training areas of each conditional class. For the test sample, 1200 pixels of each class were selected using a random number generator. Given that the “Burned Area” class has only 871 pixels, “sampling with replacement” was applied when forming the training sample. Therefore, the test sample for this class did not contain unique pixels, which almost did not affect the final result. It is worth noting that sampling with replacement led to possible duplication of “training” and “test” pixels for other classes.

I used satellite images from the Sentinel-1A, Sentinel-2A, and Landsat-8 satellites for the study. The main image was from Sentinel-2A, dated August 8, 2017. Additionally, I used a Sentinel-1A image from August 7 and thermal infrared channels from a Landsat-8 image dated August 12, 2017. A near-infrared (vegetation) band image from Sentinel-2A, dated April 30, 2017, was added at the final stage. The spring image allowed for a more precise separation of bulrush thickets from parks and forests.

The city boundary of Kryvyi Rih was taken from the OpenStreetMap project, excluding the “Avangard” settlement. The classification of land cover types within the “Avangard” settlement was not performed, and its area was not included in the total area of the studied territory.

As the classification algorithm, I chose Random Forest from the corresponding library of the R programming language. The number of trees in the forest I grew is 350, with each tree based on 4 variables (individual satellite image bands). The classification accuracy on the training sample reached 96.22%, with an “Out of Bag Error” of only 3.78%. The test sample showed an overall classification accuracy of 93.95%, which is quite high for such studies, given the high detail of the classification map (10×10 m). However, the accuracy of detecting individual classes varies significantly. The most significant error is shown by the “Lawn” class (25.15%), followed by the “Park” (11.45%) and “Forest” (9.78%) classes. Due to classification errors there were some mistakes in the final classification map. For example, some sections of the eastern sides of Kryvyi Rih quarries were classified as “Water” due to being in shadow during optical and radar imaging. Single pixels within residential areas were also classified as “Water,” again due to shadows from buildings. The table below shows the results of the classification model test sample. The rows contain predicted class values, and the columns contain real class values. The error in detecting each class is defined as the ratio of “incorrect” to “correct” model responses.

ClassBulrushBurned AreaForestLawnParkSolid SurfaceVillageWastelandWaterClass Recognition Error
Bulrush138006035002144/1380 = 3.19%
Burned Area02140000000
Forest10160511530020157/1605 = 9.78%
Lawn700974529318732245/974 = 25.15%
Park6905921222715592210255/2227 = 11.45%
Solid Surface00026113128144358/3128 = 1.85%
Village003328324205980150/2059 = 7.29%
Wasteland2101736001950083/1950 = 4.26%
Water70-5041300239529/2395 = 1.21%

I obtained a classification map based on the classification of the entire territory of Kryvyi Rih. With this map, we can count the number of pixels of each conditional class within Kryvyi Rih. Knowing the area of one pixel (100 sq.m), we can calculate the total area of each class. The table below shows the rounded areas of the classes.

Conditional Cover ClassTotal Area within Kryvyi Rih, ha
Bulrush (Reeds)1224
Burned Area275
Forest1832
Lawn6378
Park12562
Solid Surface12159
Village7172
Wasteland4305
Water1289

Below is the overall view of the final classification map. The online version of the map can be viewed here.

Conditional Land Cover Classes of Kryvyi Rih

Finally, I want to mention the software tools I used during my research. I used the Sentinel Application Platform (SNAP) for radar image calibration. I loaded and processed optical images using the Semi-Automatic Classification Plugin for QGIS. Most of the work on combining satellite images, delineating training areas, and forming training samples was done in SAGA GIS. I built and analyzed the classification model in the R programming language. The final graphical design of the classification map was done in QGIS. [The English translation was done using ChatGPT and Grammarly]

Leave a Comment