The Performance of Random Forest Classification Based on Phenological Metrics Derived from Sentinel-2 and Landsat 8 to Map Crop Cover in an Irrigated Semi-arid Region
The use of remote sensing data provides valuable information to ensure sustainable land cover management. In this paper, the potential of phenological metrics data, derived from Sentinel-2A (S2) and Landsat 8 (L8) NDVI time series, was evaluated using Random Forest (RF) classification to identify and map various crop classes over two irrigated perimeters in Morocco. The smoothed NDVI time series obtained by the TIMESAT software was used to extract profiles and phenological metrics, which constitute potential explanatory variables for cropland classification. The method of classification applied involves the use of a supervised Random Forest (RF) classifier. The results demonstrated the capability of moderate-to-high spatial resolution (10–30 m) satellite imagery to capture the phenological stages of different cropping systems over the study area. Furthermore, the classification based on S2 data presents a higher overall accuracy of 93% and a kappa coefficient of 0.91 than those produced by L8 data, which are 90% and 0.88, respectively. In other words, phenological metrics obtained from S2 time series data showed high potential for agricultural crop-types classification in semi-arid regions and thus can constitute a valuable tool for decision makers to use in managing and monitoring a complex landscape such as an irrigated perimeter.
KeywordsPhenological metrics Random forest Crop mapping Classification Landsat 8 Sentinel-2
Shorter wave infrared
Vegetation red edge
Irrigated areas in semi-arid regions play a strategic role in food security, providing more than half foodstuffs produced in the world [4, 49]. In Morocco, irrigated agriculture significantly contributes to the process of economic and social development, in spite of its area of only 15% of the cultivated land (about 1.5 million ha). It accounts for 45% of the agricultural Gross Domestic Product and 75% of agricultural exports, depending on the season [7, 47]. Within this framework, a strong mobilization of decision-makers has been created to establish an institutional reform, and an agricultural policy for monitoring and managing land use and land-cover efficiently in the irrigated areas.
In this context, remote sensing can be an effective tool for identifying and monitoring of crop types in agricultural regions. Several studies have commonly utilized multispectral data from a single date as an input to traditional maps of different cropping systems [34, 51, 56]. This approach captures the specific spectral response of crop types based on only one date in time. This can induce confusion between crop types caused by their spectral similarity at specific phenological stages ([2, 48]).
More recently, efforts have focused on the use of multi-temporal data, which has proven to be appropriate for monitoring and characterizing spatial and temporal patterns of crop cover changes. Taking advantage of the repeat acquisitions, time series data improve the accuracy compared to single-date mapping approaches [26, 77, 82].
The time series of multispectral data from sensors such as Landsat Thematic Mapper (TM and ETM+) and SPOT were used by many researchers at the local scale for detailed crop mapping [15, 40, 60, 79]. However, the computation time and memory management of the acquired full multispectral data during the whole cropping season are not practical due to the large data volume.
To overcome this problem, many studies have been using several vegetation indices that are derived from satellite data to identify agricultural land cover classes [1, 31, 58, 64, 71, 81, 82, 84]. Furthermore, various studies proved that the Normalized Difference Vegetation Index (NDVI), developed in the early 1970s [68, 75], correlates with plant productivity . This makes the NDVI a good indicator of measuring changes in aboveground biomass and phenology .
The time series of vegetation indices derived from remote sensing image data has allowed researchers to quantify and characterize seasonal events of plant phenological profiles according to its seasonal patterns . TIMESAT software was used to estimate the main phenological events for each pixel using the NDVI time series [38, 39]. Thirteen phenological parameters, which represent the main phenological events, were derived from phenological profiles. Several studies that used these parameters to identify and discriminate crop types at the pixel level have been based on coarse resolution satellite data, including AVHRR data , MODIS data [38, 44], and PROBAV datasets [20, 27]. However, the high temporal and spatial resolution of USGS Landsat 8 OLI and Copernicus Sentinel 2 sensors has opened up important opportunities for extracting these phenological metrics at finer spatial resolution.
In order to produce a final crop map for a specific season, it is necessary to use an image classification strategy as one of the most important application in remote sensing which aims to label each pixel in the image to a certain crop class. The crucial prerequisite for a successful cropland mapping is the right choice of a suitable classification method, image analysis approach, and pixel’s attributes [23, 50]. A multitude of classification algorithms have been developed to map crop type classification with remote sensing time series data. These methods can be broadly categorized into three main types: unsupervised classifiers, such as ISODATA [11, 78]; parametric supervised classifiers such as maximum likelihood ; and non-parametric supervised machine learning classifiers which include decision trees [24, 57], artificial neural networks , and the support vector machines .
Random Forest (RF) is one of the most recent machine learning algorithms , which has received increasing attention in the literature over recent years due to its numerous advantages (a). Some of these advantages include the low sensitivity to feature , the fast processing speed , and its robustness and stability. This approach is close to those of the Extra-Trees algorithm [22, 59]. In addition, RF showed promising results on crop mapping [5, 31, 34, 35] by exploiting its strengthened resilience and adaptation capacity for the classification of heterogeneous crop types over large areas by using remotely sensed data .
In irrigated arid and semi-arid regions in Morocco, crop cover changes monitoring provide important data for ensuring a sustainable agricultural land cover management. Thereby, the main objectives of this study are (i) to assess and compare the performance of phenological metrics derived from L8 and S2 data to map crop types in the Tadla and Triffa irrigated perimeters in Morocco and (ii) to evaluate the accuracy of RF algorithm as a classifier based on phenological metrics.
2.1 Study Areas and Ground Data
This research focuses on the irrigated perimeters of Tadla and Triffa. These particular perimeters were chosen due to several considerations, namely the strategic role in the national food security and the similar climatological and environmental conditions.
The second area of study is Triffa’s irrigated perimeter, which has an average altitude of 200 m above the sea level and an area of 36,600 ha. Triffa’s irrigated perimeter is one of the most fertile and productive areas in eastern Morocco. This study area is located within the province of Berkane and lies between latitudes 34°20′–36°00′ N and 2°10′–2°40′ W. It is limited by the Beni-Snassen mountains to the south, the Ouled Mansour hills to the north, the Kiss River to the east, and the Moulouya River to the west. The climate is semi-arid with total annual rainfall below 327 mm/year and concentrated between January and April. The mean annual temperature is 17 °C, but seasonal variability is high with a monthly temperature ranging from 11 to 25 °C. The average annual actual evapotranspiration is approximately 1200 mm/year.
Total area of crops collected during the ground survey
Training area in Tadla (Ha)
Training area in Triffa (Ha)
The ground data used in the mapping was randomly split into two independent parts, and 80% of the samples were assigned to the initialization of the classification model, while 20% of the remaining samples were used for validation and assessment of the model performance.
2.2 Satellite Images
Characteristics of Sentinel-2A(MSI) and Landsat 8 (OLI) sensors
Landsat 8 (OLI)
Spectral range (μm)
Spatial resolution (m)
Spectral range (μm)
Spatial resolution (m)
The second satellite data used in this study is the European Sentinel-2A, launched in June 2015, S2 carries the Multispectral Instrument (MSI) which has spectral response functions quite different compared to its predecessor with 13 spectral bands and three different spatial resolution as well as 10 days between revisiting time (Table 2) .
3.1 Reconstructing NDVI Time-Series
where fi represents the original NDVI value in the time series, gi is the filtered NDVI value, and n is the width of the filter window, while nL and nR correspond respectively to the left and right edge of the signal component.
3.2 Extracting Phenological Metrics
Seasonality metrics in TIMESAT
Start of season
Time for which the left edge has increased to 10% of the seasonal amplitude measured from the left minimum level
End of season
Time for which the right edge has decreased to 10% of the seasonal amplitude measured from the right minimum level
Middle of season
Mean value of the times for which the left part of the NDVI curve has increased to the 90% level and the right part has decreased to the 90% level
Length of season
Time from the start to the end of the season
The average of the left and right minimum values
Maximum NDVI value for the fitted function during the season
Difference between the peak value and the base level
The area under the smoothed curve between SOS and EOS
The area below the base level from the SOS to the EOS
Rate of increase at the SOS between the left 10% and 90% of the amplitude
Rate of decrease at the EOS between the right 10% and 90% of the amplitude
Start of season value
NDVI value at the defined start of season
End of season value
NDVI value at the defined end of season
3.3 Random Forest Classification and Feature Selection
For each irrigated perimeter, the classification was performed by the Random Forest (RF) algorithm, a non-parametric supervised learning method that is part of the machine learning classifiers. This classification method is constituted by a set of decision tree classifiers, in which each individual decision tree is randomly constructed using a bootstrap sample from two-thirds of the original training data, while the remaining one third, known as the out-of-bag (OOB) samples, are used to obtain an internal error estimate [6, 12]. Subsequently, each tree classifier casts a single vote for a specific class, and the final result was the class which had the highest number of votes by tree classifiers [12, 46, 66].
The main metrics of the RF models are the maximum number of decision trees to generate in the forest (ntree) and the number of variables used to split each node (mtry). In this study, a sufficiently high number of 500 decision trees were used in the RF modeling and a default value of mtry, which corresponds to the square root of the number of variables as recommended by Belgiu and Drăguţ  and Bernard .
The RF model proposed makes it possible to transmit information on the variables used in the classification. This information gives a general idea of the ideal variables necessary to explain the result of the classification. Therefore, it is necessary to optimize the number of features for the RF model. Ranked from the more to the less important, the optimization phase was based on an analysis of the importance of the variables used on the resulting overall classification accuracy.
In this study, the procedure of selecting and ranking key features was determined using the Mean Decrease Accuracy (MDA) according to the methodology described by Immitzer et al. . The MDA for a given variable consists of evaluating the internal error OOB of the classification before and after a random permutation of the values of the variable. If a large decrease in the OOB error is observed, then the importance of the feature in classification is higher [12, 33]. The majority of the studies reported by Belgiu and Drăguţ  used the MDA to determine the variable importance, and to further reduce the size of the dataset by removing uninformative variables with the lowest ability to discriminate between the crop classes over the whole study areas.
3.4 Crop Separability
Classification performance depends on four key factors: class separability, training sample size, dimensionality, and classifier type. In order to characterize the behavior of the phenological parameters, the studied crops boxplots and 2D feature space plot methods were visually analyzed to evaluate their separability and the ability of these parameters to discriminate the crops. These graphical techniques illustrate how training data are distributed across phenological metrics related to L8 and S2. The isolated point clouds, resulted from the scatter plot, indicate the capacity of phenological parameters to detect the behavior of the crops phenological signature.
3.5 Accuracy Assessment
The accuracy of the classification results obtained was evaluated using the testing parcels (20% of total ground data) collected during the field visits (Table 1). The accuracy statistics for these two irrigated areas were calculated on the confusion matrix that included overall accuracy (OA), Kappa coefficient, producer’s accuracy (PA), user’s accuracy (UA), and F1-score [16, 17].
4 Results and Discussion
4.1 Optimal Feature Selection and Crop Separability
Figure 4 illustrates slight differences among NDVI derived from the two sensors for the same class of crops. The most logical explanation for this distinctness could be given to directional effects, the atmosphere characteristics, and the different illumination and viewing angle depending on the sensor’s orbital parameters, which is consistent with the findings in recent studies [63, 69].
The analysis of NDVI profiles shows a clear difference between the crop types (Fig. 4). It allows us to characterize and discriminate annual crops (cereals, sugar beet, vegetables, and fallow) and perennial crops (citrus, olive, and pomegranate). Annual crops exhibit a distinct cyclic annual (sinusoidal) behavior and high amplitude  related to crop types, climatic and edaphic conditions . Perennial crops are characterized by more stable phenological behavior throughout the crop year and low amplitude for most classes .
Previous studies have generally reported that the distinction between different crops can be made visually based solely on the form and size of their NDVI temporal profiles [13, 31, 45]. These profile shapes, derived from the NDVI time series, can be exploited to derive a set of indicators (metrics) that describe the form and size of these profiles (see Sect. 3.2) and reflect the appearance of certain events in the plant life cycle, which correspond to all the phenological metrics described above.
The phenological metrics of AMPL and SINTG show almost the same behavior against the major crops studied (Figs. 6 and 7). These metrics are considered as productivity-related parameters that describe the seasonally active vegetation or seasonal change in net primary production , which can be large for annual crops and herbaceous vegetation and small for the evergreen cover types. This specific behavior of AMPL and SINTG is proven by the higher value of annual crops (cereals, sugar beet, fallow, and vegetables) that make this discrimination particularly pronounced.
The LINTG is also a productivity-related parameter with a phenological interpretation as the total of vegetation production . The larger integral value observed for the perennial crops (citrus, olive, and pomegranate) indicates more biomass production, but the annual net productivity might not be that much for these woody plants, which is clearly detected by the low value in SINTG and AMPL. This is consistent with Qin , who observed that sparse grasslands have less LINTG than the wooded grassland and the woodland has a higher LINTG with a low SINTG.
The SOSV and EOSV metrics have almost the same pattern inverse to the crop classes. It is very clear that there is not a lot of overlap between the different crops, making it simple to differentiate between them (Fig. 7). The groups of citrus, olive, and pomegranate show high values compared to annual crops (Figs. 6 and 7), which have a low value of NDVI correlating to the date of emergence and harvest, as well as to the dry season in which herbaceous plants either decline or dormant .
4.2 Crop Classification Results
The results of the extraction and selection of phenological metrics are elementary data for the development of the classification models. With two different data sets (L8 and S2 phenological metrics), the RF classification was performed to predict agricultural land cover types in both studied areas.
We examine and compare the RF models accuracy and maps performance using two assessment indicators. First, we present OOB error results for the two classification approaches as a reliable measure of classification accuracy to examine the model’s efficacy [43, 80]. Second, we used the accuracy assessment statistics such as OA, kappa statistic, UA, PA, and F1-score to evaluate and compare the quality of the classification.
Accuracy descriptive statistics
Landsat 8 (OLI)
The results showed that the classification based on Sentinel-2 phenological data was slightly more accurate with the highest overall accuracy of 93% and a kappa coefficient of 0.91. This compares with an overall classification accuracy and a Kappa coefficient of 90% and 0.88, respectively, for the classification based on the L8 phenological data. This observation confirms the results reported by previous studies of crop and land cover mapping using S2 and L8 data [42, 72, 74, 80] in which classification accuracies obtained from Sentinel-2 data are higher than the results of Landsat-8 data. It is important to realize that even though the number of classes used in our study was relatively large (i.e., 12 classes in total), our results produced a high overall accuracy compared to other studies conducted in the same context but with fewer classes. The work by Bendini et al.  reported a similar crop classification accuracies using L8 phenological data for mapping four classes of crops in Brazil. In another study, El Mansouri et al.  achieved an overall accuracy of 80% using the data fusion of Sentinel-1A and Sentinel-2 to identify seven crop classes in the Triffa Plain.
When discussing and comparing the accuracies of individual crop types on each classification approaches, we can see that the classification has achieved satisfactory accuracies among the different classes. However, the low accuracies for some classes can be seen critical for crop mapping. In particular, the pomegranate, which always shows the lowest PA, F1-score, and the UA, could be caused by two main reasons. On the one hand, as shown in Table 1, we could find that the pomegranate class was poorly represented in the studied regions during the season of 2016/2017. On the other hand, the main reason for the recorded low F1-score PA and UA was the similar spectral behavior of some of the crops with the pomegranate classes as shown in Fig. 4. The same limits can be explained by many other studies [50, 52] reporting that the number of training samples significantly affects the classification results.
After assessing the quality of the classification result, this study have demonstrated that the classification approach using the phenological data derived from Sentinel-2 achieves a higher classification accuracy than the Landsat phenological data in most classes.
Cross-comparison of official statistics and major crop area estimates derived from Sentinel-2 data over the irrigated perimeters
Crop area: official statistics
Crop area: Sentinel-2 derived
Relative error (%)
Table 5 shows that the satellite-derived crop areas present a good agreement with the updated official statistics. If we take the example of citrus in Triffa, the obtained final area estimates agree with official statistics for 2017, which indicate a citrus area of 19,800 ha. The same correspondence was observed for the olive and sugar beet in Tadla with a relative error of − 4.48 and − 1.3, respectively. Unfortunately, the other crop area estimates could not be compared due to the lack of official statistics at study areas; in general, these are not updated regularly on an annual basis, which made comparisons difficult and prevented validation to be performed.
The high accuracy obtained for the result maps demonstrates the effectiveness and reliability of the proposed approach based on phenological metrics derived from remote sensing time series. This approach can be accurate, updatable, and cost-effective for mapping and monitoring cropland compared to conventional methods and surveys that are subjective, time-consuming, and laborious.
5 Conclusions and Perspectives
Crop identification and mapping are extremely important for numerous environmental planning and research applications. Remote sensing offers an efficient and reliable means of collecting and creating information. Satellite-derived cropland products and information can provide valuable, real-time advice for sustainable agricultural development strategies and natural resources protection as it increases the possibility of large-scale operational mapping of cropland with high spatio-temporal resolution. The use of satellite imagery from a single source can be limited by the presence of clouds and shadows that introduce missing values in the datasets in addition to the difficult for capturing the seasonality of the vegetation cover. Based on this issue, our study focused on evaluating the potential of phenological metrics derived from the Sentinel-2A (S2) and Landsat 8 (L8) data in classifying and mapping crop type for two study areas in Morocco. We used the TIMESAT tools first to smooth the times series of NDVI by the Savitzky–Golay filter and second to extract phenological metrics from the smoothed NDVI time series. A supervised Random Forest classifier (RF) was used to select and optimize these phenological parameters and perform the classification by employing the selected features based on the Mean Decrease in Accuracy (MDA) approach.
The results show that the classification based on phenological metrics derived from S2 achieved a satisfactory overall classification accuracy and Kappa coefficient of 93% and 0.91, respectively. In comparison, the approach that used L8 phenological metrics had an overall classification accuracy and kappa coefficient decreased by 3%. The producer’s accuracy, the user’s accuracy, and F1-score improved for most crop types in the classification based on S2 compared to L8 phenological information.
The approach presented can potentially be replicated in other regions in Morocco and the world to identify crops. Our results prove that this data has the ability to produce accurate maps of relevant farming systems, especially with the launch of new satellites such as Sentinel-2B. These images are now provided on a 5-day basis. Also, they should improve the availability of input data (NDVI Series) and facilitate subsequent applications of the approach developed for crop mapping. This is in spite of the data volume to be processed that involves a very long computation time and a limitation in terms of memory limits of the software used.
Finally, this research allowed us to map the major crop classes in the irrigated perimeters of Tadla and Triffa in Morocco. It is important, in perspective, to establish complementary research to improve this approach for mapping crops at national and regional scale.
- 7.Benabdelouahab T, Balaghi R, Hadria R et al (2016) Testing Aquacrop to simulate durum wheat yield and schedule irrigation in a semi-arid irrigated perimeter in Morocco: testing Aquacrop to simulate durum wheat yield and schedule irrigation. Irrig Drain 65:631–643. https://doi.org/10.1002/ird.1977 CrossRefGoogle Scholar
- 8.Bendini H, Sanches ID, Körting TS et al (2016) Using Landsat 8 image time series for crop mapping in a region of Cerrado, Brazil. ISPRS - Int Arch Photogramm Remote Sens Spat. Inf Sci XLI-B8:845–850. https://doi.org/10.5194/isprsarchives-XLI-B8-845-2016 CrossRefGoogle Scholar
- 10.Bernard S (2009) Forêts Aléatoires: De l’Analyse des Mécanismes de Fonctionnement à la Construction Dynamique. Phd diss, Université de RouenGoogle Scholar
- 13.Brooks CN, Schaub DL, Powell RB et al (2006) Multi-temporal and multi-platform agricultural land cover classification in southeastern Michigan. In: proceedings of ASPRS 2006 annual conference. Reno, Nevada, p 12Google Scholar
- 21.Eklundh L, Jönsson P (2012) TIMESAT 3.1 software manual. Lund Univ Swed 1–82Google Scholar
- 22.El Mansouri L (2013) Object-based approach and tree-based ensemble classifications for mapping building changes. In: Proceedings of the fifth international conference on advanced geographic information systems, applications, and services GEOProcessing, Nice, pp 54–59Google Scholar
- 23.El Mansouri L, Lahssini S, Hadria R et al (2019) Time series multispectral images processing for crops and Forest mapping: two Moroccan cases. In: El-Ayachi M (ed) El Mansouri L. Geospatial Technologies for Effective Land Governance, IGI Global, pp 83–106Google Scholar
- 31.Hao P, Wang L, Zhan Y, Niu Z (2016) Using moderate-resolution temporal NDVI profiles for high-resolution crop mapping in years of absent ground reference data: a case study of bole and Manas counties in Xinjiang, China. ISPRS Int J Geo-Inf 5:67. https://doi.org/10.3390/ijgi5050067 CrossRefGoogle Scholar
- 41.Kussul N, Skakun S, Shelestov A et al (2015) Regional scale crop mapping using multi-temporal satellite imagery. ISPRS - Int Arch Photogramm Remote Sens Spat Inf Sci XL-7(W3):45–52. https://doi.org/10.5194/isprsarchives-XL-7-W3-45-2015 CrossRefGoogle Scholar
- 45.Lee E (2014) Analysis of MODIS 250 m NDVI using different time-series data for crop type Separability. PhD diss., University of KansasGoogle Scholar
- 46.Liaw A, Wiener M (2002) Classification and regression by randomForest. R News 2:18–22Google Scholar
- 47.Lionboui H, Benabdelouahab T, Elame F et al (2018) Estimating the economic impact of climate change on agricultural water management indicators. PERTANIKA J Sci Technol 26:749–762Google Scholar
- 53.McCloy KR, Lykke AM (2009) Validation of phenological change indices as derived from time series of image data. In: Proceedings of Multitemp 2009. Mistic, Connecticut, pp 307–314Google Scholar
- 55.Ouatiki H, Boudhar A, Tramblay Y, et al (2017) Evaluation of TRMM 3B42 V7 rainfall product over the Oum Er Rbia Watershed in MoroccoGoogle Scholar
- 61.Qin C (2011) Assessing phenological changes and drivers in East Africa from 1982 to 2006. PhD diss., Michigan State UniversityGoogle Scholar
- 68.Rouse JW Jr, Haas RH, Schell JA, Deering DW (1974) Monitoring vegetation systems in the Great Plains with Erts. In: Proceedings of the 3rd earth resource technology satellite (ERTS) symposium, Washington, pp 309–317Google Scholar
- 69.Roy DP, Li J, Zhang HK et al (2017) Examination of Sentinel-2A multi-spectral instrument (MSI) reflectance anisotropy and the suitability of a general method to normalize MSI reflectance to nadir BRDF adjusted reflectance. Remote Sens Environ 199:25–38. https://doi.org/10.1016/j.rse.2017.06.019 CrossRefGoogle Scholar
- 73.Steenkamp K, Wessels KJ, Archibald S, Von Maltitz GP (2009) Satellite derived phenology of southern Africa for 1985–2000 and functional classification of vegetation based on phenometrics. In: proceedings of the 33rd international symposium of remote sensing of the environment (ISRSE), Stresa, p 4Google Scholar
- 74.Topaloğlu RH, Sertel E, Musaoğlu N (2016) Assessment of classification accuracies of Sentinel-2 and Landsat-8 data for land cover/use mapping. ISPRS - Int Arch Photogramm Remote Sens Spat Inf Sci XLI-B8:1055–1059. doi: https://doi.org/10.5194/isprsarchives-XLI-B8-1055-2016 CrossRefGoogle Scholar
- 81.Wardlow BD, Egbert SL (2005) State-level crop mapping in the US Central Great Plains agroecosystem using MODIS 250-meter NDVI data. In: Proceedings of Pecora 16 Symposium, Sioux Falls, South Dakota, pp 23–27Google Scholar
- 83.Wessels K, Steenkamp K, von Maltitz G, Archibald S (2011) Remotely sensed vegetation phenology for describing and predicting the biomes of South Africa: remotely sensed vegetation phenology of South Africa’s biomes. Appl Veg Sci 14:49–66. https://doi.org/10.1111/j.1654-109X.2010.01100.x CrossRefGoogle Scholar