## 2 Materials and Methods
### Training of Models  
The pre-processed images were cut into square patches (aspect rate = 1) to be used in the segmentation models. The patches present horizontal and vertical overlap and its size is proportional to the spatial resolution of each original image. In addition to the images, the vector data containing the ground truth with the delimitation of the canopies was also cut following the same cut grid. So, each sample used for training or detection inference corresponds to a patch. Two segmentation models were defined: the first (RGB model) using RGB images with the three original ortho-mosaic bands (Red, Green and Blue) and the second (RGBC model) using images with 4 bands, namely Red, Green, Blue, and CHM. To homogenize the radiometric resolution between the bands of the RGBC model images, the CHM was converted to 8 bits by a linear transformation. Hence, all the bands of the patches used in each model have a pixel value range between 0 and 255. The analysis considered the three areas under study indistinctly, since the focus of the work is to evaluate and compare the canopy detection capacity of RGB and RGBC images, considering the spatial complexity and variability of planting characteristics, such as orange variety, age of orchard, presence of vegetation cover, or exposed soil between planting lines and different tree heights and planting densities. Therefore, training, validation of training, and inference were performed considering the three plots uniformly. In total, 1715 patches were used for each of the two models, with 1031 (60%) used for training, 342 (20%) for training validation, and 342 (20%) for testing. The characteristics adopted in each patch set are shown in Table 2. For all patches in the three fields adopted, the maximum number of instances (canopies or fractions) per patch was 30. The two models were similarly trained, with an initial learning rate of 0.001 and a momentum of 0.9. The epoch corresponds to a cycle of use for all training samples, which is formed by iterations (batch size). These in turn may have the same number of samples. Fifty epochs were adopted, each with 1031 iterations and, to increase the learning process,  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Plot**} & \multicolumn{3}{c}{**Dimensions**} & \multirow{2}{*}{ \begin{tabular}{c} **Osel** \\ **(x per x)** \\ \end{tabular}  } & \multirow{2}{*}{\ \begin{tabular}{c} **Osel** \\ **(px)** \\ \end{tabular}  } & \multirow{2}{*}{ \begin{tabular}{c} **Area** \\ **(cm)** \\ \end{tabular}  } & \multicolumn{3}{c}{**Number of Patches**} \\ \cline{3-8}  & & & & & **Train. ** & **Val. ** & **Test** & **Total** \\ \hline A & 512 & 11.3 & 100 & 2.2 & 128.7 & 399 & 133 & 133 & 665 \\ B & 256 & 18.2 & 60 & 7.1 & 330 & 196 & 64 & 64 & 324 \\ C & 512 & 12.8 & 100 & 2.5 & 163.8 & 436 & 145 & 145 & 726 \\a 10-fold reduction in the training rate was considered between epochs 15 and 27 (0.0001), 27 and 39 (0.00001), and 39 and 50 (0.000001). The models were not randomly started during the training process. Both networks were loaded with pre-training parameters of the COCO dataset. However, the parameters loaded correspond to pre-training on RGB images and because the RGBC model is executed with 4-band images, the weights of the first layer for this model were started randomly. Additionally, data augmentation was randomly applied to the training images prior to their entry into the models, and the changes applied to each of the samples correspond to one or two of the following transformations: (1) horizontal mirroring, (2) vertical mirroring, (3) rotation by 90\({}^{\circ}\), 180\({}^{\circ}\), or 270\({}^{\circ}\), and (4) change in the brightness value of pixels in the interval between 50% and 150%. The evaluation of the Mask R-CNN training and validation is carried out by a set of metrics and each one evaluates a particularity of the detection activity.