## 3 Method  
Figure 1 shows the framework of the proposed CAS-DA (DA detector with cascade RPNs) for tree-crown detection and counting, including a Strong Weak Faster R-CNN and the cascade RPNs. We summarize these modules in our framework as follows.  
(a) Strong Weak Faster R-CNN: The method is inherited from Faster R-CNN; it narrows the domain shift at local and global levels by local discriminator \(D_{l}\) and global discriminator \(D_{g}\). The gradient reversal layer (GRL) connects the domain discriminator with the feature extraction network to achieve adversarial training. We focused on the process of feature extraction, represented by a series of blue cuboids in Figure 1. For clarity, we briefly review the structure of the feature extraction network (taking ResNet-101 [56] as an example) here. As shown in Table 1, the blocks consist of a series of convolutional layers successively named Conv1, Conv2_x, Conv3_x, Conv4_x, and Conv5_x. Conv1\(\sim\)Conv4_x are responsible for extracting convolutional features of images from the source and target domains. Conv5_x is a region-of-interest (ROI)-based classifier. The loss function of the Strong Weak Faster R-CNN is composed of local-level adaptation loss \(L_{loc-img}\), global-level adaptation loss \(L_{global-img}\), and the detection loss of Faster R-CNN \(L_{det}\).  
(b) Cascade RPNs: As shown in Figure 1, this module consists of three RPNs with the same structure; they are sequentially attached to Conv2_x, Con3_x, and Conv4_x of the Strong Weak Faster R-CNN to obtain multilevel features. Since the feature map from Conv4_x has a different size from that of from Conv2_x and Conv3_x, convolutional blocks composed of a convolutional layer and an average pooling layer are deployed between the RPN and Strong Weak Faster R-CNN pipeline for integration convenience. These multilevel features are fed into the corresponding RPN to generate proposals. Afterwards, the RPN classifier outputs binary classification probability for each proposal. The higher the probability value, the more likely there is a tree crown in the proposal. Then, we set a threshold value at each stage, the easy samples whose classification score is greater than or equal to the threshold are rejected at this stage and do not participate in the training of latter stages.. The loss of cascade RPNs consists of three classification loss of all three RPNs and the regression loss of RPN3.  
In this paper, we concentrated on the unsupervised DA tree-crown detection across two different regions. Specifically, we defined images from labeled source domain \(R_{s}\) as \(D_{s}=\{(x_{i}^{s},y_{i}^{s})\}_{i=1}^{n_{s}}\), and images from unlabeled target domain \(R_{t}\) as \(D_{t}=\{(x_{i}^{t})\}_{i=1}^{n_{t}}\), where \(y_{i}\) is the labels of \(x_{i}\), and \(n_{s}\) and \(n_{t}\) represent the number of images from the source domain and the target domain, respectively.  
In the following sections, we explain the implementation of cascade RPNs, the integration details with Strong Weak Faster R-CNN and the filtering strategy successively.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Layer Name** & **Layer Structure** \\ \hline Conv1 & \(7\times 7\), 64, stride 2 \\  & \(3\times 3\) max pool, stride 2 \\ Conv2\_x & \(\begin{bmatrix}1\times 1,&64\\ 3\times 3,&64\\ 1\times 1,&256\\ 1\times 1,&128\\ 1\times 1,&512\\ \end{bmatrix}\times 3\) \\ Conv3\_x & \(\begin{bmatrix}1\times 1,&256\\ 3\times 3,&256\\ 1\times 1,&1024\\ 1\times 1,&512\\ \end{bmatrix}\times 4\) \\ Conv4\_x & \(\begin{bmatrix}1\times 1,&256\\ 3\times 3,&256\\ 1\times 1,&1024\\ 1\times 1,&512\\ \end{bmatrix}\times 23\) \\ Conv5\_x & \(\begin{bmatrix}1\times 1,&512\\ 3\times 3,&512\\ 1\times 1,&2048\\ \end{bmatrix}\times 3\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Structure of ResNet101.  
Figure 1: The framework of the proposed method.