RiceMapEngine: A Google Earth Engine-Based Web Application for Fast Paddy Rice Mapping

Mapping rice area is a critical resource planning task in many South Asia countries where rice is the primary crop. Remote-sensing-based methods typically rely on domain knowledge, such as crop calendar and crop phenology, and supervised classification with ground truth samples. Applying such methods on Google Earth engine (GEE) has been proven effective, especially at large scale owing to the comprehensive and up-to-date data catalog and massive server-side processing power. However, writing scripts through the code editor requires users to program in JavaScript and understand GEE application programming interface (API), which can be challenging for many researchers. Thus, this article presents a GEE-based web application that aims to eliminate the programming requirements for data selection, preprocessing, and visualizations so that users can easily produce rice maps and refine ground truth collections through intuitive graphical user interfaces (GUI). This software includes three submodule apps, namely the ground truth collection app, threshold-based rice mapping app, and classification-based rice mapping app. Users can customize data processing flow using GUI designed with Bootstrap, and the backend server uses GEE Python API, and a Google service account for authentication to execute the workflow on Google cloud servers. The experiment shows that both the overall accuracy and Kappa scores of the mapping result are higher than 0.9, which suggests that RiceMapEngine can significantly reduce the complexity and time costs it takes to produce the accurate rice area maps and meet the demands of real-world stakeholders.

and Southeast Asia (SEA) due to ample rainfall and warm temperatures. It is the dominant crop type in many agrarian SA and SEA countries, such as Bangladesh, Nepal, and Vietnam. According to the International Rice Research Institute, paddy rice fields in SEA account for almost 30% of the world rice harvest. Thus, rice farming in SA and SEA is important to regional and global food security, which is a pivotal theme in United Nations' 17 Sustainable Development Goals. Decision makers and planners depend on timely reported information on paddy rice area and vegetation growth to estimate rice yields and plan resource allocations and contingency plans accordingly. Thus, timely producing the accurate rice extent maps is crucial for helping the formulation of strategic agricultural plans that ensures food security, especially for densely populated countries, such as Bangladesh, India, and Vietnam [3].
Remote-sensing datasets, including both optical multispectral sensors, e.g., moderate resolution imaging spectroradiometer (MODIS), Landsat, and Sentinel-2, and radar sensors, e.g., RADARSAT and Sentinel-1, have long been used in rice mapping [4], [5], [6]. Dong et al. [4] summarized three categories of methods that are generally used by previous research in mapping rice using remote-sensing images. The first category is to use statistical approaches, such as supervised learning and unsupervised classification, on images from certain stages of rice planting. For example, Onojeghuo et al. [5] combined normalized difference vegetation index (NDVI) time series during the rice-growing period derived using Landsat images and polarization bands (i.e., VV and VH from Sentinel-1A images) and used supervised classification models, including support vector machine (SVM) and random forest (RF) to classify paddy rice fields in northeast China. Their best results were from using time-series VH and NDVI with RF, which yields a 96.7% accuracy. Chen et al. [7] trained multiple RF models using combinations of all polarization bands from Sentinel-1 and NDVI, land surface water index (LSWI), and enhanced vegetation index (EVI) derived from Sentinel-2 for the paddy rice classification. Their results showed that the best accuracy is achieved with the combination of VV, VH, and EVI. The second category is to use time-series data and threshold-based segmentation methods, and the last category is by detecting the transplanting phase, during which the fields are flooded. Vegetation indices, such as NDVI, or water indices, such as LSWI or modified normalized difference water index (MNDWI), can be used during this phase to detect water in the fields. This distinct phase of paddy rice phenology has been widely used in previous research. Xiao et al. [8] classified paddy rice in southern China by comparing LSWI and NDVI during the transplanting phase till the full canopy exists. Their assumption was that during the transplanting phase, LSWI would be greater than NDVI. In particular, numerous studies have specifically targeted the SA region to explore various remote-sensing techniques, especially various remote-sensing-based (e.g., MODIS) vegetation indices, for mapping and modeling agricultural features, such as paddy rice, flooded crops, cropland fallow, drought, and irrigated areas [9], [10], [11], [12], [13], [14], [15], [16].
Traditionally, processing remote-sensing data is a nontrivial task because of the sheer volume of data that needs to be downloaded and processed at the local workstation. However, the advent of Google Earth engine (GEE) [17] and the recent development from Microsoft's AI for Earth, the planetary computer [18], and Earth observation data cube [19], [20], [21], [22] have made the processing of remote-sensing data much easier, thanks to the underlying cloud computing infrastructure. GEE provides researchers with abundant application programming interfaces (APIs) to process and visualize remote-sensing datasets by writing JavaScript code in the online code editor. The large catalog of remote-sensing-related datasets available and the built-in data filtering APIs make it very convenient to select images that are relevant to the time frame and study area of interest [23]. Aside from expediting the research process, GEE is also beneficial to open research because researchers can share the scripts that generated the research results, which can be easily used by other researchers to reproduce the research. As a result, we can observe an exponentially increasing trend in GEE publication numbers since the introduction of GEE. GEE can also be used to build web applications. The advantage of building a web application is that it can engage users who do not have JavaScript experience with easy-to-use graphical user interfaces (GUIs). GEE JavaScript APIs include built-in UI components such that researchers can build simple web applications right in the online code editor and host the applications with Google app engine. O-LCMapping [24] is one good example, which provides users with GUIs to select ground truth data on the map, specify satellite sensors, image date ranges, band combinations, machine learning (ML) models, and model parameters, and then use user-defined parameters in a supervised or unsupervised land cover classification workflow [24]. AgKit4EE is a suite of useful functions for in-season crop type mapping and visualizing cropland data layer data based on the user-defined configurations [25], [26]. Another type of web application that can be implemented using GEE is the free-form app that only uses GEE-provided computing power rather than the UI components. This type of web application is much more flexible but requires substantially more work to design, implement, and deploy. For example, climate engine is sophisticated software that provides users with plenty of options to visualize and download climate and remote-sensing data for natural resource monitoring purposes [27]. Yalew et al. [28] presented a GEE-based web framework for agricultural land suitability assessment named AgriSuit. The framework uses GEE in the backend for data processing and computing and implements a web client to collect user inputs and visualize processing results. REMAP is a web application for land cover classification similar to the O-LCMapping except that it uses GEE Python APIs instead of JavaScript APIs [29]. Gumma et al. [30] utilized GEE to process and assess irrigated cropland, major crop types, and cropping intensity products of SA.
Previous research has demonstrated that paddy rice classification by detecting the transplanting phase or by supervised classification with time-series remote-sensing data can yield satisfactory results. Web-based applications that use GEE APIs can effectively reduce the barrier of JavaScript programming and offer remote-sensing data processing workflows to a wider range of people. While there are web applications, such as O-LCMapping and REMAP, that allow general land cover classification, which may be used for rice mapping, there are certain challenges that need to be addressed for rice mapping. Specifically, collecting ground truth samples for rice just by inspecting high-resolution true-color images, such as Google Earth satellite layers, is not adequate because different crop types cannot be differentiated on true-color images.
This research aims to address these issues by developing a web application, which we named RiceMapEngine, that allows users to refine ground truth samples based on their phenology information rather than relying solely on true-color images. The RiceMapEngine will utilize the computing power and data catalog of GEE for fast paddy rice mapping by either supervised classification or a phenology-based approach. This application intends to allow remote-sensing practitioners who do not program in JavaScript to be able to produce rice maps with GEE. As this application is more data processing focused, unlike visualization-focus applications, such as ClimateEngine, it requires users to have a basic understanding of remotesensing concepts, such as NDVI, composite, and ML models. Nonetheless, this application will potentially allow a much larger user groups, such as government officials with some trainings to use remote sensing for critical agriculture-related decision making.

A. Software Design
The RiceMapEngine is designed as a modern single-page web application (SPA). An SPA is an application that loads entirely when it opens. It differs from a traditional server-rendering web application, e.g., a Tethys-based web application [31], which dynamically renders web pages at the server side throughout the entire life cycle of the web application. We believe that SPA suits the design of RiceMapEngine better because of several reasons. 1) SPA is more suitable for complex interactions between users and the application, such as uploading/modifying ground truth samples, and going back and forth between each stage of crop mapping, etc. 2) GEE requests can take seconds or even minutes to respond to, which is not user-friendly. Thus, RiceMapEngine tries to reduce the number of calls to the backend GEE APIs as much as possible. A powerful SPA frontend can alleviate the load of the backend. 3) SPA develops UI as reusable components, which is more suitable for open source. The overall software architecture is illustrated in Fig. 1. The frontend shows the map component and controls for user input, and the backend essentially serves as a proxy that translates requests from the frontend into GEE Python API calls. The entire application is organized as three different apps, namely, phenology explorer, empirical thresholding, and supervised classification. Each of these apps represents a stage of the crop mapping process.
On the front-end side, the three apps are organized behind client-side routing. SPA and client-side routing enable these apps to share commonly used components, such as header, map, and footer, and only reload necessary parts of the pages depending on the current URL, which is extremely helpful when the web map component needs to be shared across all apps. A redux store is used to hold states and data of the current user session, e.g., user-selected dataset name, image date range, user-uploaded ground truth samples, etc. This model-view-like structure is very friendly to open source because a new application can be easily added to the entire application by adding a client-side route and a new redux store slice.
To facilitate the use of SPA for the front-end design, the backend of the application is developed as an API server using the Django framework in Python. The backend uses a Google service account to authenticate all GEE requests for the application as the application starts up. The Google service account associates GEE requests to the account itself, rather than an end user, which is recommended for developing applications or RESTful APIs. As the heart of the backend, a suite of frequently used functions for data processing, such as selecting and filtering datasets on GEE, and computing features, is implemented using GEE Python APIs. These functions are implemented to be as generic as possible to handle a range of possible inputs. This approach involves capturing user interactions with the GUI, such as selecting geospatial layers or applying specific processing functions, and translating these actions into corresponding GEE API function calls. We have implemented a custom mapping of GUI elements to Python code snippets, which allows us to dynamically generate the appropriate GEE API code based on the user's selections. For example, the compute_feature function dynamically selects the formula and bands for computation according to the input satellite name and the feature name as the function arguments. Fig. 2 shows the overall flow of using RiceMapEngine for rice mapping. The following sections discuss the details of the components. 1) Dataset Filtering: As satellite datasets on GEE are organized as ee.ImageCollection objects, the first step of using remote-sensing datasets from GEE is often applying filters to select the relevant portion of the dataset. Apart from filtering datasets by the date range and the study area, additional filters can be applied to different datasets, e.g., maximum cloud cover, descending and/or ascending orbit, etc. RiceMapEngine allows users to select a range of publicly available satellite datasets, Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply. including both passive optical sensors and active radar sensors. Table I lists all the datasets that are included in the RiceMapEngine application. The Sentinel-1 SAR data are selected by default as it is not affected by cloud cover and has high spatial resolution. While it is generally preferred to use radar data in areas with high cloud cover, which is usually true for rice-growing regions, users are encouraged to test both radar and optical data to choose the best for their use cases, especially in areas without much cloud cover. For optical datasets, the application allows users to specify the maximum percentage of cloud cover for the image without looking up the specific property from the metadata of the dataset. For the radar dataset, i.e., Sentinel-1 SAR dataset, a default interferometric wide swath-mode filter is applied, and users can select to include images in descending and/or ascending orbit.

B. Core Functions
2) Preprocessing: The preprocessing module mainly includes three functions, computing an index-like feature, composition, and speckle filtering for SAR data.
The RiceMapEngine uses the concept of "feature" to denote a single indicator for time-series analysis and classification. The feature can be either a single band, such as the VH polarization band from Sentinel-1, or a computed value using multiple bands, such as NDVI. For optical sensors, the RiceMapEngine provides the two most popular vegetation indices, NDVI and EVI, and two commonly used water indices, namely normalized difference water index (NDWI) and MNDWI. We include these two water indices because NDWI is a more well-known water index and MNDWI has a decision boundary closer to 0 and that MNDWI is less sensitive to false positives from built-up area. NDVI is the most popular vegetation index for measuring biomass. EVI is a more advanced vegetation index because it addresses some atmospheric conditions and canopy background noise problems with NDVI. NDWI is one of the most popular indices for mapping surface water. MNDWI is a modification to the NDWI, and it mainly addresses the problem of false positives with built-up areas using NDWI. For radar sensors, the VV band, VH band, cross ratio, and radar vegetation index (RVI) are provided by default. The VV band and VH band are original polarization bands from Sentinel-1 data, and they have been used for rice mapping in previous research [5], [7]. Table I lists all the features that can be selected or computed for each of the included datasets in the RiceMapEngine.
The next main preprocessing step is making composites. This step is very important because the study area may sit across swaths, which leads to inconsistent time series for the area located on different swaths. The composite can also help reduce the cloud cover problem. The main parameters in making composites are how many days of the composite are needed and what composite type to use, i.e., which aggregation method to use for observations within a composite date range. RiceMapEngine allows users to enter the days of composite they need, and a default 15-day composite is provided. The composite type can be selected from mean, maximum, minimum, median, and mode, which are the most common aggregation methods for making composites. For example, maximum composite is constantly used for making NDVI or EVI composite.
Finally, the speckle filtering preprocessing step is very important for SAR image processing. Speckles are unique to SAR images. They are made from constructively or destructively compounding signals of neighboring pixels, which deteriorate the quality of SAR images and make it hard to interpret SAR images [32]. There are many speckle filtering methods. Spatial multilooking is probably the simplest form of speckle filtering. Although such speckle filters often reduce the spatial resolution of the original images, the fast computation and convenience make them extremely popular [33], [34], [35], [36]. A boxcar filter is one such filter that calculates the spatial average for each pixel [37]. The filter can be easily implemented on GEE with a square kernel function. Another slightly more advanced multilook speckle filter is the Lee filter [38]. In addition to the average intensity within the window, the Lee filter also takes local variance into the computation [39]. Later, a modification based on the Lee filter was introduced by Yommy et al. [40], and it was named the Refined Lee filter. We implemented these three speckle filters in the system. However, due to the limited computation resources allocated to GEE users, the refined Lee filter and the Lee filter fail to consistently run through all processing steps due to their increased computation intensity. Thus, the boxcar speckle filter of window size 5 is used as the default for speckle filtering in the system.
3) Phenology Inspection: One important feature of RiceMapEngine is that it allows for inspecting the phenology of ground truth samples. Ground truth samples for rice mapping may include samples from different crop types, which are indifferentiable from single-look high-resolution images, such as Google Earth. Phenology-based indicators, such as startof-season, peak-of-season, end-of-season, and season length, can help effectively differentiate different crop types [41]. The transplanting phase of rice phenology uniquely differentiates it from other crop types [42]. Thus, ground truth samples of rice can be verified if the transplanting phase can be identified from its phenology. With multispectral images, transplanting phase of rice can be identified by detecting water using NDVI as water has much lower NDVI values than vegetations.
RiceMapEngine implements this function by combining the dataset filtering function and the preprocessing function. Specifically, users need to specify which satellite dataset and the time frame of the images to be used. Then, the preprocessing steps are applied to the selected satellite dataset to produce a consistent composite. The composite is then sampled at each ground truth sample location to get the time-series values. Then, the ground truth samples with time-series values appended to their property list are returned to the frontend for visualizations. A time-series line chart will be plotted for a selected ground truth sample such that the users can inspect the time series to identify phenologybased indicators. In addition to the time-series phenology curve selected by users, RiceMapEngine also loads month-by-month false-color composite for each month within the selected time frame. The false-color composite is made using an optical remote-sensing dataset. The dataset is dynamically selected depending on the selected frame. For example, the Sentinel-2 TOA reflectance dataset will be used if the time frame starts after June 2015 because the first image of Sentinel-2 was captured in June 2015. The month-by-month false-color composites serve as visual clues aside from the time-series phenology curve to assist in inspecting the selected ground truth sample.

4) Classification:
The last core function is paddy rice classification. RiceMapEngine provides two methods of rice mapping, one based on empirical statistics and the other based on ground truth samples. Both methods produce binary-class classifications, i.e., rice and nonrice.
The first method implements a simple threshold-based classification. After specifying the parameters for dataset filtering and preprocessing, users can specify time frames of satellite image data to be used and the thresholds for the feature values during such time frames. Pixels that satisfy the conditions will be classified as rice, while all other pixels, including noncropland pixels, are classified as nonrice crop types. The mathematical representation of this method is shown as follows: where X i are the observations within time frame i, and a i and b i are the thresholds for time frame i. The rice mapping results take the logical and operation of thresholding results from all time frames. The second method is supervised classification, which requires users to upload ground truth samples as zipped shapefiles. With the flexible data transfer functionality, RiceMapEngine will significantly simplify the incorporation process with our end-users in Nepal. After applying the dataset filtering and preprocessing steps, which are standard procedures for many tasks in RiceMapEngine, users can specify classification-specific parameters, such as the time frame of images to be used, which model to use, and training details. Table II presents the supported classification models and their GEE APIs. We included multiple models that are supported by GEE and widely used with Earth observation data. We try to strike a balance between offering flexibility and ensuring user-friendliness. RF is selected by default as it is a robust and accurate classifier for most applications. Internally, the selected image datasets will be filtered and preprocessed into composites, and the uploaded ground truth samples will be used to sample from the composites to attach image data to the samples. Then, the selected model will be trained using the training set of the ground truth samples. The trained model will be used to produce the rice map. Finally, the accuracy assessment step is conducted using the testing set. The confusion matrix, overall accuracy (OA), and Kappa coefficient [43] will be reported.

A. Main Workflows 1) Phenology Explorer:
The first major function of RiceMapEngine is called phenology explorer. It aims to allow users to fine tune the ground truth samples using time-series satellite data as evidence and derive empirical thresholds for different phenological stages. It enables an interactive experience for users to examine ground truth samples collected from the field. The steps to use this function are as follows.
1) Upload ground truth samples to the app, the supported formats for the ground truth data are zipped shapefile and GeoJSON. The ground truth samples are then converted to JSON objects and stored in the front-end redux store. Samples are then shown in a list as well as on the main map canvas. 2) Choose the property and the property value that is the target class (e.g., "rice" value in the property "cereal"). The samples that match the selection are highlighted both in the list and on the map, which helps differentiate samples that belong to the positive class and the negative class. 3) Specify the dataset name, filtering criteria, and preprocessing methods. 4) Select the date range of interest. The date range of interest defines the time frame that the images will be loaded. It also initializes mini-zoomed-in maps corresponding to each month within the time frame for sample inspection at finer resolution later. 5) Send a request to the backend and fetch time-series feature values for all samples. Also, load monthly false-color composite for each of the mini-zoomed-in maps. 6) Show the time-series feature values as a chart when a feature is selected either from the list of samples or the map. The sample should also be highlighted in each of the mini-zoomed-in maps such that the whereabouts of the sample location can be examined for each month within the selected time frame. 7) Examine a sample according to the chart of the time-series curve and the zoomed-in minimaps to delete the invalid samples or edit the sample location on the map and go back to the previous step for another iteration. 8) If satisfied with the quality of samples, users can enter the date ranges of the sowing, peak, and/or harvesting phase, and get the minimum and maximum values for that phase. The minimum and maximum are derived using all values within the time frame of the phase from all samples that belong to the positive class. Outliers are eliminated using the "interquartile" rule. The interquartile is defined as the third quartile minus the first quartile, and the outliers are identified as any values that are outside the range between (quartile 1st − 1.5 * interquartile) and (quartile 3rd + 1.5 * interquartile). After removing outliers, the minimum and maximum thresholds are defined as the (mean − std) and (mean + std) [48].

2) Empirical Thresholding:
The empirical thresholding function aims to allow users to classify the target crop type using known threshold values or empirical threshold values derived from the phenology explorer. This function can be used independently but is recommended to be used after phenology explorer. Crop type mapping often relies on domain knowledge, such as phenology and crop calendar. Such information is very helpful for choosing a specific time frame that can best differentiate the target crop type from other crop types. This function provides a simple method for unsupervised classification using domain knowledge. The steps to use this function are simple.
1) Specify the dataset name, filtering criteria, and preprocessing methods. 2) Specify the auxiliary datasets, including the boundary for classification, which can be a predefined Nepal district boundary, or an uploaded zipped shapefile, and a crop mask, which should be a public asset on GEE. The crop mask for Nepal is used as default. 3) Switch on the sowing, peak, and/or harvesting phases and specify the time frame and threshold values for each phase that is turned ON. 4) Run the classification on the backend, then show the classification result for each of the turned-ON phases and a combined result from all phases. The estimated area of the target crop type will also be calculated. 5) Export classification results as single-band GeoTIFF images where the target crop is of value 1 and other classes are of value 0.

3) Supervised Classification:
The supervised classification function provides another method for rice mapping along with empirical thresholding. This function allows users to upload ground truth samples or use the ground truth samples uploaded from the phenology explorer for supervised classification. The steps to use the supervised classification function are as follows.
1) Specify the dataset name, filtering criteria, and preprocessing methods.
2) Upload ground truth samples or reuse ground truth samples uploaded from phenology explorer and specify the property and property value as the target class label. 3) Specify the classification-related inputs, including classification model parameters (e.g., number of trees, variables per split, minimum leaf population, and bag fraction), date range of images to be used in classification, the ratio of data to be used in model training, the GEE classification model to be used, and the corresponding model parameters. 4) Run the supervised classification and return the result as XYZ tiles to be visualized on the map. Panel (1) shows GUIs of data filters and preprocessing setups. The options of features dynamically change along with the dataset selection.

B. Use Interface Design
Panel (2) shows the date range selectors for the sowing, peak, and harvesting phenology stages and the threshold values for the corresponding season. Each season can be switched ON or OFF to include or exclude it in the workflow.
Panel (3) shows GUI controls for classification parameters, including the date range of images to be used, the model to be used, and the model parameters for the selected model.
Panel (4) shows the zoomed-in false-color monthly composites for the selected date range. Each month within the date range is shown as a small map. When a ground truth sample is highlighted, all maps will center on the sample such that the whereabouts at the sample location during the selected time period can be clearly observed.
Panel (5) shows the container of ground truth samples; users can upload ground truth samples as zipped files, and the samples will be shown in the container as a list. To differentiate the rice class from other classes, the class field and class value need to be selected from the properties of the samples. For example, the "Rice" value from a property named "Crop type" needs to be selected to differentiate rice samples and other samples.
Panel (6) is a panel that shows the time series of selected satellite data for the selected ground truth sample.
In addition to the panels, the main component that occupies the screen is the map. The map was implemented using the Leaflet web mapping library. The map stays stationary across different workflows and the UI panels change according to the currently selected workflow. For the phenology explorer, the panel (1), (4), (5), and (6) will show up. For empirical thresholding, only panel (2) will show up, and finally, panel (3) will show up for the supervised classification workflow. The RiceMapEngine prototype is implemented and accessible at https://cloud.csiss.gmu.edu/servir/rice-explorer/phenology.

C. Case Study
The RiceMapEngine was used for rice mapping operations in Nepal in 2021, and it will be used for rice mapping operations in 2022 and onward. This case study shows how RiceMapEngine was used for the Chitwan districts in the Terai belt region of Nepal. In short, the phenology explorer workflow was used to inspect the phenology of ground truth samples collected in 2020 to identify stale samples, the transplanting time frame, and the empirical thresholds for Sentinel-1 SAR data in the transplanting time frame. Next, the empirical thresholding workflow was used to produce the in-season rice map for 2021 using thresholds derived from the last step. Finally, the supervised classification workflow was used to produce postseason rice maps for 2021 using ground truth samples collected during the main season of 2021. Fig. 4 shows the location of the Chitwan district within the Terai belt region, and the cropland mask is applied. The ground truth samples that are used in this case study, including 356 samples collected in 2020 and 294 samples in 2021, are also shown in the figure. Field trips were conducted by government officials of Chitwan during the main seasons in 2020 and 2021 to collect ground truth samples. Both sets of ground truth samples include samples of multiple crop types in addition to rice, and the nonrice crop types are grouped as one class in the subsequent classifications.

1) In-Season Rice Mapping in 2021:
One key feature of RiceMapEngine is to support rice mapping with simple thresholding. This allows in-season mapping if empirical thresholds can be known in front. In this case study, the in-season rice map of Chitwan in 2021 was produced using ground truth samples from 2020. Specifically, the ground truth samples from 2020 were uploaded to the phenology explorer, and the time period of phenology data was set to January 1st to December 31st, 2020. Fig. 5 shows the zoomed-in maps for one of the rice samples. From the false-color composite images for each month, we can see that the cloud cover completely blocks the view from May to September, and the images in October show signs of bare soil around the sample location, which indicate the harvesting phase.
As we can see, the optical images are blocked by cloud cover during the critical transplanting and growing season of rice. Thus, the Sentinel-1 SAR data were chosen for phenology inspection. The VH band from Sentinel-1 SAR data was chosen as the feature of the plot. A 15-day median composite processing is included in the preprocessing pipeline. Fig. 6 shows the time series of the VH band for the same rice sample, as shown in Fig. 5. As Sentinel-1 SAR data are not interfered with by cloud cover, the time series is, thus, continuous. From the time series, we can clearly match the curve with the month-by-month false-color composites because the VH curve shows low values for October, which means the biomass is low. From the curve, we can also see that the peak is sometime in September, and the transplanting phase should have happened in mid-July. By using both the optical sensor readings and the sensor readings from radar sensors, the phenology stages of rice can be clearly identified. Based on the observed phenology, necessary corrections or deletion can be done to samples if the classes of the samples do not match with their observed phenology.
Based on the phenology of the rice samples, the transplanting time frame can be roughly estimated. In this case study, the transplanting phase was set from June 15th to July 31st, and the derived VH band value ranges during this period from −23.67 to −16.89. This range is then used in the empirical thresholding workflow to create an in-season rice map for 2021. The in-season map for 2021 can be produced right after the transplanting phase using Sentinel-1 SAR images during the selected time frame for the transplanting phase. Fig. 7 shows the produced in-season rice map. The reported area of the paddy rice fields according to this in-season rice map is 27 958.251 ha.
The ground truth samples from 2020 were used to derive an in-season rice map for 2021 based on the assumption that the transplanting phase happens at roughly the same time across years, and the satellite recordings are stable across years. These    assumptions need to be true such that the VH band value range derived using ground truth samples from 2020 can extrapolate to 2021. However, if such assumptions are not valid, especially when the transplanting phase windows are different across years, the uncertainty level of the in-season rice map may be high. Nonetheless, the in-season rice map can still be very useful for planning purposes as it can be produced earlier before the completion of the season, and more importantly, the map is produced without the requirement of ground truth samples from the current year.
In the case of Chitwan, RiceMapEngine not only demonstrated its capability for rapid rice mapping but also greatly supported the Nepal local government in agricultural administration. With the in-season mapping results, the end-users can construct rice store points in the district and then easily store rice after the harvest and balance the demand and supply.
2) Postseason Rice Mapping in 2021: As discussed in Section III.C.1, the in-season rice map can be derived purely from empirical thresholds without the need for ground truth samples. When the main season is over, the postseason rice map can be derived using newly acquired ground truth samples during the growing season. ICIMOD conducted field trips in the entire  Terai belt region during the main growing season of rice in 2021 and collected over 8000 ground truth samples. There are 294 samples located in the Chitwan district. A straightforward supervised classification can be conducted using satellite images. In this case study, we again used Sentinel-1 SAR images as it is not affected by cloud covers. The same 15-day median composite is applied to produce a consistent and continuous time series. The image date range is chosen from June 1st, 2021, to November 1st, 2021, to roughly include the main season of rice with some margin on both sides. The model we used was an RF model with 200 estimators, and the rest parameters are set with default values. To validate classification results, a random 70% of the 294 samples were used in model training and the rest were used for accuracy assessment. Fig. 8 shows the result of the postseason classification. The reported area of paddy rice fields according to the postseason rice map is 21 220.913 ha. The confusion matrix and accuracy assessment are shown in Table III. From the result, we can see that the classification result is satisfactory as both the OA and Kappa scores are higher than 0.9, which means that the classification result agrees well with the ground truth data.
Comparing the postseason rice map and the in-season rice map, we can see that the postseason rice map shows less paddy rice area than the in-season map, which means that the in-season rice map has a lot of overestimations. The actual area reported by RiceMapEngine for the in-season rice map is 27 958.251 ha and the reported area for the postseason rice map is 21 220.913 ha. Thus, around 25% of the area shown is false positives. Considering that the in-season rice map is derived without ground truth samples, the postseason rice map is more reliable with the ground truth information acquired during the growing season.

IV. CONCLUSION
This research presents a rice mapping application, named RiceMapEngine, that uses GEE Python APIs to provide advanced rice mapping workflows to remote-sensing researchers and decision makers. The most desirable feature of RiceMapEngine is that it allows users to use GEE services without possessing programming skills, which can bridge the gap between many researchers and the GEE. Moreover, the RiceMapEngine addressed the problem that high-resolution true-color images are inadequate to inspect ground truth samples for rice mapping by visualizing month-to-month NDVI composites and time series so that the users can visually identify the transplanting phase and the overall phenology of the samples. The application allows users to conveniently tweak parameters to produce the best results. The software design and architecture of RiceMapEngine are discussed in detail. Three main workflows, namely phenology explorer, empirical thresholding, and supervised classification, are introduced, and a case study for rice mapping in the Chitwan district of Nepal using the workflows is demonstrated and discussed.
In this case study, the phenology explorer workflow was used to identify the transplanting time frame and identify low-quality ground truth samples. Then, in the empirical thresholding workflow, the thresholds for the VH band of Sentinel-1 SAR data within the transplanting phase were calculated and were used in the threshold-based classification, which yields the in-season rice maps for 2021. After the season was over and ground truth samples for 2021 were collected, the RiceMapEngine was used to conduct postseason rice mapping using models trained with the ground truth samples for 2021. Meanwhile, this case study shows that RiceMapEngine can be used for year-to-year continuous rice mapping operations with the in-season maps that provide early estimates of paddy rice area and extent, and the postseason maps that provide the most accurate estimates of main season paddy rice area and extent.
High-quality crop maps and associated yield estimate not only bridge information needs among the federal and subnational institutions of Nepal but also provide a means for consistent crosscountry crop status assessments and communication. While relatively new, this technology is already supporting agricultural management from the national level to the community level. The collaborative effort has made a significant contribution to the Ministry of Agriculture and Livestock Development's adoption of new data-driven technologies.
To further improve the in-season rice mapping, we will develop a data fusion approach and combine multisource satellite data, such as MODIS and Landsat 8/9, into the classification model. We anticipate that the accuracy of in-season maps will be enhanced, even in regions where obtaining cloud-free images is challenging, as the fusion of different data sources can complement the gaps in each other's coverage. While our study focuses primarily on rice mapping, the underlying methodologies and techniques can be adapted for other crop types as well. Users interested in leveraging the application for different crops can do so with some modifications. In future work, we will explore expanding the application to support a broader range of agricultural crops and provide guidance on how users can effectively engage with the tool for their specific crop requirements. Additionally, while the proposed methodology has been effectively demonstrated in Nepal, we recognize that the application's performance may vary when applied to different landscapes and ecological settings. To address this, we plan to integrate more adaptive techniques that can better accommodate diverse geographic contexts, ultimately enhancing the overall generalizability of our application.

CODE AVAILABILITY
The source code of the RiceMapEngine prototype is available on GitHub at the following links.