## 2 Materials and Methods
### Training Data Generation  
RadWet-L follows a supervised machine learning classification approach, where training data is automatically generated in the central Amazon region in the floodplain between the Negro and Solimoes rivers west of their confluence at Manus (Figure 1b). This region experiences a pronounced seasonal flood pulse and contains large areas of inundated forest and open surface water that vary in extent over the hydrological year. There are also large areas of the other terrestrial classes able to provide sufficient training to be representative of the whole basin.  
Training data was generated for two binary classifiers. One classifier was trained for the detection of Inundated Forest vs all other landcovers, and a second classifier was trained to map Open Water vs all other landcovers. This approach was adopted following [24], which demonstrated improved classification accuracy compared to a more complex multi-class classification system when applied to Sentinel-1 C-band imagery for classification of open water, inundated herbaceous vegetation, and background dry land in Western Zambia. Figure 3 provides a summary of the workflow for generating the training data as well as an overview of how this is used to train the two classifiers. Figure 4 shows the preparation of ALOS-2 PALSAR-2 tiles and the subsequent application of the trained classifiers. Details of the training and classification procedures are provided in the sections below.  
Training data for each class is developed on a per \(1\times 1\) degree tile basis, for all tiles available over the central Amazon region between 2019 and 2022 (1794 tiles in total) covering a range of hydrological conditions. This comprehensive training dataset ensures that the subsequent classifier is capable of detecting inundation at any time of year within any part of the basin.  
Training data was generated for each class through the application of a rule-based approach resulting in a mask for each class (described below). Shepherd image segmentation [48] was then applied to each class mask. Subsequent segments were populated with base statistics and the training samples were exported to a Pandas dataframe [49] and stored as an HDF5 file. This object-based approach was used to reduce the influence of the inherent speckle within SAR images, where isolated pixels which are particularly bright or dark compared to surrounding pixels are merged with surrounding pixels forming a single object. This also has the added benefit of reducing the computing time required to perform a classification, as there are fewer objects to classify compared to classifying each pixel.  
Figure 4: Flow diagram outlining the data preparation and classifier application for each ALOS-2 PALSAR-2 in the Amazon River Basin.  
Figure 3: Flow diagram summarising the RadWet-L automatic training data generation process and classifier training.  
This process was applied to each tile, and for each class producing a structured data table of training samples for each tile. All the training samples from each tile were concatenated and shuffled, producing one larger training dataset that could be used to train and optimise the classifiers.  
This approach offers improvements over the original RadWet-C algorithm which attempts to generate training data, train two binary supervised machine learning classifiers over 25 replicates each, and apply these classifiers on a per-scene basis [24]. RadWet-L generates training data from representative tiles and trains a global classifier applied to subsequent tiles, removing the need to retrain a new classifier for each tile and reducing computational demand.