## 2 Materials and Methods
### Data Analysis
#### 2.3.2 Identification of Japanese Oak Crowns Using the ResU-Net Model  
In the present study, the orthophotos of the September and October UAV datasets were cropped into small patches of 512 \(\times\) 512 pixels to avoid overloading the computer memory.  
Figure 4: The ResNet101 architecture developed by [PERSON] et al. (2016) [37].  
Figure 3: The sketch of the U-Net model with ResNet101 backbone.  
For each dataset, 217 images, covering the full number of annotated oaks, were generated, resulting in 217 corresponding labeled masks. Due to the small number of our datasets, we tested by splitting the dataset into different training and validation ratios (i.e., 70% and 30%, 80% and 20%, 90% and 10%, 89% and 11%, respectively) to ensure a meaningful evaluation of the model's performance. After these tests, since 89% and 11% provided the best performance of the model, 89% of the images and masks were used for model development and 11% were allocated for validation. The validation dataset consisted of 24 images that included only Japanese oaks recorded in the field (n = 17). For quick testing of the model's performance on new data during model development, the training dataset was split into a training set (80%) and a test set (20%).  
For network training, we employed the Adam optimizer configured with the specified learning rate of 0.0001. Regarding loss function, we used the composite function, which includes both dice loss and focal loss, to balance the importance of different loss components during training. While dice loss is useful for dealing with class imbalance in segmentation tasks (i.e., where the positive (target object) and negative (background) classes are not evenly distributed), focal loss introduces a modulating factor to assign more weight to challenging samples and allows for the improved accuracy of boundary detection (SERP AI, [[https://serp.ai/loss-functions/](https://serp.ai/loss-functions/)]([https://serp.ai/loss-functions/](https://serp.ai/loss-functions/)), accessed on 31 January 2024). The combined strengths of these two loss functions are particularly important in sparse instance tasks such as Japanese oak crown segmentation.  
As the accuracy scores of the model during training were unstable until epoch 100 after test runs, the models were trained for 100 epochs for all UAV datasets, with the best model saved using the ModelCheckpoint callback function provided in the Keras library. Each epoch of all of the UAV datasets had eight batches, with a verbosity of 1. After the ResU-Net models had been trained, the watershed separation approach, commonly employed in the separation of overlapping tree crowns in images [39; 40], was used to separate the borders from the crowns of Japanese oaks in the predicted images. The general flow of the entire procedure for identifying Japanese oaks is shown in Figure 5.  
Figure 5: General workflow for mapping the distribution of Japanese oak crowns in an uneven-aged mixed forest using UAV imagery (orthophoto) and the ResU-Net model.  
ResU-Net models were coded in Spyder (version 5.4.1) using the Python programming language with a Keras front end and a TensorFlow back end [13]. When a 2 ML54 VSB laptop (ASUSteK Computer Inc., Taipei, Taiwan) with an AMD Ryzen 7 4800H processor and 16.0 GB of RAM was used, the model training time for each non-augmented UAV dataset was 330 s per epoch, and that for each augmented UAV dataset 290 s per epoch.