# Improving Landslide Recognition on UAV Data through Transfer Learning
## 3 Methodology
### Target Detection Based on Transfer Learning  
Transfer learning can improve the model performance by transferring knowledge from the source domain. In this way, the reliance on large amounts of labeled data could be reduced. For landslide detection, no similar large-scale open dataset is available. Therefore, we proposed a feature-based transfer learning algorithm. As shown in the Figure 6 below, generally the characteristics of landslides include that the mountain is covered with green vegetation, and that the falling soil and rocks will form a certain accumulation. Such color, texture, and morphological features would be helpful if could be extracted from the source domain dataset and transferred to the target domain dataset for landslide detection.  
Figure 7 shows the transfer learning flow chart. The goal of the transfer learning is to transfer knowledge from the existing source domain data and shorten the training time of the model. The convolutional neural network (CNN) for pre-trained models is composed of convolutional layers and fully connected layers, and the image data processing is as follows.  
Figure 6: Schematic diagram of the feature transfer learning.  
* Feature extraction: the input image is a two-dimensional matrix, using a trainable filter group to compute the convolution with a step size. Each filter corresponds to a specific feature.
* Feature maps: an activation function is used to map the results of the filter to ensure the validity of the feature, and the feature map is obtained.
* Feature pooling: the feature dimensions of any image are in the millions after convolution. If the output was used to train the classifier directly, it would cause overfitting. Therefore, the feature pooling or downsampling is needed. The feature map is divided into disjoint regions with a size, and the average value of these regions is calculated and taken as the pooling feature. The pooled feature dimension is greatly reduced and could be used to train the classifier.
* Feature parameter transfer: the feature weights obtained from the source domain data pre-training are applicable to the target domain datasets. We choose to freeze all the layers outside of the fully connected layers and retrain an output layer through the target data.
* Feature classifier: the feature vector obtained based on the transfer learning serves as the input of an SVM categorizer and is used for training the landslide detection model.  
The feature extraction is performed to obtain a set of feature vectors that can describe the image and is important for image classification and model training. The initial several layers of the networks capture basic and low-level features. These feature weights can be guaranteed and perform well in the model classification. By using pre-trained models trained on the source images, we can directly apply the corresponding structure and weights to the target detection. Finally, the images are recognized by the retrained model and improve the work efficiency.  
The loss function of the transfer learning model is composed by the classification loss and domain transfer loss. Generally, a cross-entropy function is used to calculate the classification loss.  
The domain transfer loss function minimizes the distance between the target domain and the source domain, so that to constrain the extracted features shared by these domains. We use the maximum mean discrepancy (_MMD_) to measure the domain distance. The domain transfer loss is expressed as follows:  
\[L_{D}=MMD(X,Y)=\left\|\frac{1}{n}\sum_{i=1}^{n}\varphi(x_{i})+\frac{1}{m}\sum_{ j=1}^{m}\varphi\big{(}y_{j}\big{)}\right\|, \tag{4}\]  
where \(n\) and \(m\) are the numbers of instances of two different domains, \(x_{i}\) and \(y_{j}\) are the instances in the source domain and target domain respectively, and \(\varphi\left(\cdot\right)\) is the kernel that converts two sets of features to a reproducing kernel Hilbert space (RKHS).  
Figure 7: Transfer learning flow chart.