4.2 Application of the RF Classification
4.2.1 RF 1993’s and 2023’s LULC maps
The map of LULC extracted using the RF classification for the year 1993 shows the same 6 LULC classes (Fig. 7a). The study area's smallest superficies are composed of Bare ground (59 km2) (Table 8). The Agricultural areas and Rangeland have the highest superficies (932 and 933 km² respectively). Forest and Scrubland occupy respectively 37 and 72 km². There were almost no Water bodies in 1993. The second map related to 2023 (Fig. 7b) shows that Forests occupy 118 km², Scrubland 324 km², Bare ground 25 km², Rangelands 716 km², Agricultural areas 851 km², and Water bodies only 0.5 km² (Fig. 8).
Determining the classification accuracy is essential after image classification. Using the stratified sampling technique, the QGIS SCP plugin accuracy assessment tool randomly generated 500 reference points for each of the 1993 and 2023 classified images (Fig. 8). A color and a pixel value are allocated to each point. The user will then have to manually select the right class when the generated points have been detected. Random positions are selected for field verification. It should be noted that field trips, as well as the use of high-resolution Google Earth Pro images, are essential for regional mapping of land use and cover. To identify the changes detected using RF classification, the areas of the various LULC units between 1993 and 2023 were highlighted. The Kappa coefficients for the 1993 and 2023 images were 0.82 and 0.77, respectively, while the overall classification accuracy was 86% and 81%. To evaluate the reliability of the classified images, a confusion matrix and an accuracy evaluation table were generated for each classified image (1993 and 2023) (Tables 9 and 10).
Table 8
Areas of LULC classes (RF classification) observed in 1993 and 2023
Classes | Area in1993 (%) | Area in 1993 (Km²) | Area in 2023 (%) | Area in 2023 (Km²) | Regression/ Progression (Km²) |
Forest | 2 | 37 | 6 | 118 | 81 |
Scrubland | 4 | 72 | 16 | 324 | 252 |
Agricultural area | 46 | 932 | 42 | 851 | -81 |
Rangeland | 46 | 933 | 35 | 716 | -217 |
Bare ground | 3 | 59 | 1 | 25 | -34 |
Water bodies | 0 | 0 | 0 | 0.5 | 0.5 |
Total | 100 | 2036 | 100 | 2036 | 0 |
4.2.2 RF LULC confusion matrix and accuracy assessment in 1993
Tables 9 and 10 present the confusion matrix (in pixels) for the Landsat 5 TM image from 1993. The overall accuracy (OA) of the classified image is 86%, which is deemed satisfactory for validating the classification. The Kappa coefficient is 0.82, indicating a high level of agreement among the classes. The computation of the producer accuracy (PA) and the user accuracy (UA) were performed. Producer accuracy (PA) computation for the different RF classes indicated that Bare ground exhibited the highest PA among all the classes (93%), followed by Forest and Scrubland (86% for each of them), and Agricultural areas (85%). The lowest PA was observed for Water bodies (80%). Furthermore, UA was calculated for all generated classes of the classified image. The highest UA was recorded for Scrubland (90%), followed by Agricultural areas (88%), Bare ground (87.5%), Forest (85.71%), Rangeland (80%), and Water bodies (80%).
Table 9
RF LULC confusion matrix for the Landsat 5 TM 1993 image
| Forest | Scrubland | Rangeland | Water bodies | Agricultural areas | Bare ground | Total |
Forest | 60 | 5 | 0 | 0 | 5 | 0 | 70 |
Scrubland | 10 | 90 | 0 | 0 | 0 | 0 | 100 |
Rangeland | 0 | 5 | 80 | 0 | 10 | 5 | 100 |
Water bodies | 0 | 0 | 0 | 20 | 5 | 0 | 25 |
Agricultural areas | 0 | 0 | 10 | 5 | 110 | 0 | 125 |
Bare ground | 0 | 5 | 5 | 0 | 0 | 70 | 80 |
Total | 70 | 105 | 95 | 25 | 130 | 75 | 500 |
Table 10
Accuracy assessment for the Landsat TM 1993 image
| Forest | Scrubland | Rangeland | Water bodies | Agricultural areas | Bare ground |
PA | 86 | 86 | 84 | 80 | 85 | 93 |
UA | 85.71 | 90.00 | 80.00 | 80.00 | 88.00 | 87.50 |
OA (%) | 86 |
Kappa | 0.82 |
4.2.3 RF LULC confusion matrix and accuracy assessment in 2023
For the Landsat 8 OLI image from 2023, a confusion matrix (in pixels) is provided in Table 11. Compared to the other classes, the Scrubland class is the most accurate. In this classification, the OA is 0.81 and the Kappa coefficient is 0.77, indicating substantial agreement between classes (Table 12). Among all the extracted classes, Bare ground has the highest PA at 100%, followed by Agricultural areas (91%), Forest (83%), Rangeland (74%), and Scrublands (73%). Water bodies recorded the lowest PA (56%). UA was also calculated for all classes of the RF image (Table 12), showing high values for all LULC classes. OA is 81%. Agricultural area and Rangeland classes are predominant, while Forest, Scrubland, Bare ground, and Water bodies are less prevalent. The high value of OA (0.81) of our mapping indicates its reliability for LULC analyses. Regarding the spatial arrangement of landscape elements, our mapping reveals that Agricultural areas and Rangelands dominate, while Forest, Scrubland, Bare ground, and Water bodies constitute a smaller proportion.
Table 11
RF LULC confusion matrix for the Landsat 8 OLI 2023 image
| Forest | Scrubland | Rangeland | Water bodies | Agricultural areas | Bare ground | Total |
Forest | 50 | 10 | 0 | 5 | 5 | 0 | 70 |
Scrubland | 10 | 80 | 0 | 5 | 0 | 0 | 95 |
Rangeland | 0 | 5 | 70 | 5 | 0 | 0 | 80 |
Water bodies | 0 | 0 | 5 | 25 | 5 | 0 | 35 |
Agricultural areas | 0 | 10 | 15 | 0 | 100 | 0 | 125 |
Bare ground | 0 | 5 | 5 | 5 | 0 | 80 | 95 |
Total | 60 | 110 | 95 | 45 | 110 | 80 | 500 |
Table 12
RF accuracy assessment for the Landsat 8 OLI 2023
| Forest | Scrubland | Rangeland | Water bodies | Agricultural areas | Bare ground |
UA | 71.43 | 84.21 | 87.50 | 71.43 | 80.00 | 84.21 |
PA | 0.83 | 0.73 | 0.74 | 0.56 | 0.91 | 1.00 |
OA (%) | 0.81 |
Kappa | 0.77 |
4.3 Transition matrix and change detection of LULC from 1993 and 2023
One of the different ways for detecting land cover changes is the transition matrix, which contributes to revealing the spatiotemporal land cover transformation in table form (Bagwan and Sopan Gavali 2021). The transition matrix's primary purpose is to show the historical and current state of the various classes. These statistics can offer real assistance to decision-makers in tracking LULC changes and formulating suitable strategies for national development and natural resource preservation. Many Remote Sensing and GIS studies utilize the LULC transition matrix to assess LULC change patterns quantitatively (Takada et al. 2010). The area that has undergone a transition from one LULC class to another between two times, t0 and t1, is visible thanks to the change matrix comparison technique (Daba and You 2022). For each LULC class, the transition matrix shows the areas of changes in LULC, and the diagonal values indicate the areas of LULC that persist between the initial and final times, with rows indicating the transitions from the initial time and columns indicating the transitions from the final time (Viana et al. 2020).
The developed transition matrix related to the SVM classification depicts the various transition routes for each LULC class between 1993 and 2023 (Table 13). Regarding Forest class (FR), approximately 6 km² have been converted into Scrubland (SL), 1 km² into Rangeland (RL), and 1 km² into Agricultural areas (AA). 30km² of Forest areas (FR) remained unchanged. 40 km² of Scrubland areas (SL) were transformed into Forests (FR). Overall, the Forest class (FR) has gained 63km² of surface area between 1993 and 2023. For the Scrubland class 51 km² are unchanged, around 31 km² have been converted to Forest (FR), 4 km² to Rangeland (RL), and 40 km² to Forest (FR), while 134 km² of Agricultural areas (AA) have gone to Scrubland areas (SL). The Scrubland areas (SL) increased from 112 km² in 1993 to 323 km² in 2023 with a gain of 211 km². For Agricultural areas (AA), 326 km² remains unchanged, about 134 km² has been converted to Scrubland class (SL), 133 km² to Rangeland (RL), and 1 km² to Water bodies (WB). For the Rangeland class (RL), 646 km² remain unchanged, about 7 km² have been converted into Bare ground (BG) and 1 km² into Water bodies (WB). At the same time, 374 km² of Rangeland class (RL) went to Agricultural areas (AA) and 131 to Scrubland class (SL). For Bare ground (BG) 18 km² remain unchanged and around 14 km² have been converted into Agricultural areas (AA), 69 km² into Rangeland (RL), and 1 km² have gone into Scrubland class (SL). This implies a decrease of 77 km² for Bare ground (BG) during the period 1993–2023. Regarding the Water bodies class (WB), it did not exist in 1993 since it was a dry year where the quantities of rain were very low with a rate of 230 mm (DGRE, 1994). It can be concluded that for the period 1993–2023, major changes were observed in the Agricultural areas (AA) and Rangeland (RL) classes. Agricultural areas (AA) increased from 625 km² in 1993 to reach an area of 732 km² in 2023. This transgression was mainly at the expense of the Rangeland class (RL) with an increase of around 107 km². Rangeland (RL) went from 1159 km² in 1993 to 853 km² in 2023, with a regression of 306 km² for 30 years.
Table 13
Transition matrix of LULC related to SVM classification, observed between 1993 and 2023
Year | 2023 | Regression/ transgression (km²) (1993–2023) |
1993 | LULC Class | Forest | Scrubland | Agriculture areas | Rangeland | Bare ground | Water bodies | Total 1993 (km²) |
Forest | 30 | 6 | 1 | 1 | 0 | 0 | 38 | + 63 |
Scrubland | 40 | 51 | 17 | 4 | 0 | 0 | 112 | + 211 |
Agricultural areas | 31 | 134 | 326 | 133 | 0 | 1 | 625 | + 107 |
Rangeland | 0 | 131 | 374 | 646 | 7 | 1 | 1159 | − 306 |
Bare ground | 0 | 1 | 14 | 69 | 18 | 0 | 102 | − 77 |
water bodies | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + 0.05 |
Total 2023 (km²) | 101 | 323 | 732 | 853 | 25 | 2 | 2036 | |
Table 14 related to the RF classifier shows that concerning the Forest class (FR), around 6 km² were converted into Scrubland (SL) and 1 km² into Rangeland (RL), and around 30 km² remained unchanged. For Scrubland class (SL), 18 km² remained unchanged but around 42 km² were converted to Forest (FR), 2 km² to Rangeland (RL), and 10 km² to Agricultural areas (AA). For Agricultural areas (AA), 439 km² remained unchanged but about 165 km² were converted to Scrubland class (SL), 294 km² to Rangeland (RL), 33 km² to Forest (FR), and 1 km² to Bare ground (BG). For Rangeland (RL), 481 km² remained unchanged but about 8 km² were converted to Bare ground (BG), 14 km² to Forest (FR), 134 km² to Scrubland (SL), while 296 km² were converted to Agricultural areas (AA). For Bare ground (BG), 15 km² were unchanged. But around 6 km² have been converted into Agricultural areas (AA), and 38 km² into Rangeland (RL). The Water Bodies (WB) did not exist in 1993 because it was a dry year. For the period 1993–2023, major changes were observed (Fig. 9): a decrease in the areas of the three classes, namely RL (− 117 km²), AA (− 81 km²), and BG (− 34 km²). On the other hand, increases in the areas of the three other LULC classes, namely SL (+ 252 km²), FR (+ 81km²), and WB (+ 0.5 km²). We can see in Fig. 9 the RF and SVM changes between the different LULC classes from 1993 and 2023.
Table 14
Transition matrix of LULC related to RF classification, observed between 1993 and 2023
Year | 2023 | Regression/ transgression (km²) (1993–2023 |
1993 | LULC Class | Forest | Scrubland | Agriculture areas | Rangeland | Bare ground | Water bodies | Total 1993 (km²) |
Forest | 30 | 6 | 0 | 1 | 0 | 0 | 37 | + 81 |
Scrubland | 42 | 18 | 10 | 2 | 0 | 0 | 72 | + 252 |
Agricultural areas | 33 | 165 | 439 | 294 | 1 | 0 | 932 | − 81 |
Rangeland | 14 | 134 | 296 | 481 | 8 | 0 | 933 | − 117 |
Bare ground | 0 | 0 | 6 | 38 | 15 | 0 | 59 | − 34 |
water bodies | 0 | 0 | 0 | 0 | 0 | 2 | 3 | + 0.5 |
| Total 2023 (km²) | 118 | 324 | 751 | 816 | 25 | 2 | 2036 | |
In the field, the total surface of Forest (FR) and Agricultural areas (AA) has significantly increased in the study area according to the registered 1993 data and the predicted data for 2023 by the National Agricultural Observatory (ONAGRI) service of the Ministry of Agriculture, Hydraulic Resources and Fisheries in collaboration with the Food and Agriculture Organization of the United Nations (FAO) (ONAGRI 2022; Di Gregorio 2022). The surface area in km² of each LULC class in the Tessa watershed in 1993 and 2023, along with their corresponding percentages, are shown in Table 15 extracted from the ONAGRI report (ONAGRI 2022). This report explains the food security policy, and strategies for the preservation and development of agricultural resources followed by the Ministry of Agriculture, Hydraulic Resources, and Fisheries. According to this report detailed in Table 15, Rangeland (RL) and Agricultural areas (AA) together accounted for 31% and 54% of the watershed's total area in 1993, respectively. The remaining area of the watershed is made up of Bare ground (7%), Scrubland (5%) and Forest (2%). It should be noted that for the year 1993, a very dry year, water bodies were absent. In 2023, the predicted percentage of agricultural, scrubland, and forest areas is expected to rise to 37%, 15%, and 5%, respectively. However, a regression for Bare ground (BR) (3%), and Rangelands (RL) (40%) was expected. All of these ground truth data are consistent with the results obtained by the SVM classifier and conflict with the results of the RF classifier.
Table 15
LULC classes and change observed for 1993 and predicted for 2023 (ONAGRI 2022)
Class | Area in1993 (%) | Area in 1993 (Km²) | Area in 2023 (%) | Area in 2023 (Km²) | Regression/ transgression (Km²) |
Forest | 2 | 42 | 5 | 98 | 56 |
Scrubland | 5 | 99 | 15 | 306 | 207 |
Agricultural area | 31 | 640 | 37 | 761 | 121 |
Rangeland | 54 | 1105 | 40 | 810 | -295 |
Bare ground | 7 | 150 | 3 | 60 | -90 |
Water bodies | 0 | 0 | 0 | 1 | 1 |
Total | 100 | 2036 | 100 | 2036 | 0 |
Based on the results of Table 16 the areas relating to the SVM classifier are very close to those of ground truth (GT) data provided by the Ministry of Agriculture, Hydraulic Resources and Fisheries (ONAGRI 2022). On the other hand, the areas relating to the RF classifier, are less similar. It was clear from the SVM results that the Forests FR increased by 56 km², the Scrublands SL by 207 km², and the Agricultural areas AA by 121 km². Furthermore, the Rangeland RL and the Bare ground BG classes decreased by 295 and 90 km² respectively. By subtracting the results of the ground truth from those of the SVM classifier, we found that for the same period, ranging from 1993 to 2023, there is only a very slight increase for classes AA, SL, and WB (water bodies) as well as for classes FR, SL, and BG. It is clearer from Fig. 10 that there is a higher degree of conformity between the ground truth and SVM results than between the ground truth and RF results. In Fig. 11, we compared the change predictions made by SVM and RF classifiers from 1993 to 2023 with the ground truth GT change data. This comparison shows that the SVM conforms to the GT ground truth more closely than the RF classification.
Tableau 16 Analysis of 1993–2023 change results (transgression or regression) related to SVM and RF classifiers compared to ground truth GT change
| SVM change | RF change | GT change | GT change - SVM change | GT change - RF change |
FR | + 63 | + 81 | + 56 | − 7 | − 25 |
SL | + 211 | + 252 | + 207 | − 4 | − 45 |
AA | + 107 | − 81 | + 121 | 14 | 202 |
RL | − 306 | − 217 | − 295 | 11 | − 78 |
BG | − 77 | − 34 | − 90 | -13 | − 56 |
WB | + 0.5 | + 0.5 | + 1 | 0.5 | 0.5 |
4.4 SVM and RF Algorithms Accuracy Comparison
Particularly in the area of Remote Sensing image analysis, where dimensionality is very high, the SVM is considered as a useful classifier (Chi and Bruzzone 2007). Furthermore, only one subset of training data is needed to make decisions. SVM is one of the most efficient techniques in memory since just this fraction of training data needs to be kept there. On the other hand, since Breiman introduced the RF classifier in 2001, it has gained popularity for use in classification, prediction, analysis, selection, and external detection. Due to its good classification results and simple, comprehensible decision-making process (Bassa et al 2016), as well as its ease of implementation in a parallel structure to accelerate geo-big data processing (Wright and Ziegler 2015), RF has become more and more popular in the land cover classification field.
In our study, when the Landsat 5 TM image from 1993 is put through to the SVM method, the overall accuracy obtained is 88.24% with a Kappa value of 0.8, whereas the Landsat 8 OLI image from 2023 yields an overall accuracy of 99.4% with a Kappa value of 0.99. Using the RF algorithm, the 2023 Landsat 8 OLI image yielded an overall accuracy of 81% with a Kappa value of 0.77, while the 1993 Landsat 5 TM image yielded an overall accuracy (OA) of 86% with a Kappa value of 0.8. Change detection analysis between 1993 and 2023 proved that compared to the ground truth data, the SVM results are more accurate. Sheykhmousa et al. (2020) examined and compared RF and SVM applications in 251 peer-reviewed journal papers and found that the SVM classifier is more effective when fewer classes are used. Statistically speaking, input data with fewer than or equal to six classes is with higher accuracy. In this instance, the mean number of classes is roughly 5.5, while the mean number of classes where RF performs better is 8.4. This is consistent with the current study, in which the number of classes is 6 and the SVM method was found to be the most accurate, according to the results of the different skill measures.