# HRU-Net: High-Resolution Remote Sensing Image Road Extraction Based on Multi-Scale Fusion
## 3 Experiments and Results
### Experimental Settings  
#### 3.2.1 Hyperparameter Settings  
The experimental parameters for this study's model were determined based on numerous preliminary experiments and subsequently refined through extensive experimentation. The training process employed cross-validation, wherein both the training and validation sets were input into the model. After each training iteration on the training set, a batch size of data was selected from the validation set to calculate the model's loss and accuracy, optimizing the model's training. Due to GPU computing power constraints, the input image size was adjusted to 256 \(\times\) 256 pixels, and the computationally efficient Adam optimizer was used to update network parameters. Each batch processed eight images. The learning rate was initially set to 0.0001, with a minimum learning rate of 0.000001, and the number of training iterations was set to 100. The model in this study was a binary classification problem that performed pixel-wise classification to determine whether each pixel is a road or background. Since roads constitute approximately 10% of the total area in the remote sensing image, this study considered the commonly used cross-entropy loss function for road extraction, while also taking into account the Dice coefficient loss function, typically used in medical image segmentation, to mitigate the issue of imbalanced samples [35]. In the case of binary classification, the calculation formula for the cross-entropy loss function is shown in Equation (3):  
\[L_{BCE}=-\frac{1}{N}{\sum_{i=1}^{N}}\bigg{[}y_{i}\log\bigg{(}\dot{y_{i}}\bigg{)} +(1-y_{i})\log\bigg{(}1-\dot{y_{i}}\bigg{)}\bigg{]} \tag{3}\]  
where \(y\) represents the true pixel label value, \(\dot{y_{i}}\) represents the predicted label pixel value by the model, and \(N\) represents the number of pixels. The Dice loss function is a measure of set similarity, typically used to calculate the similarity between two samples, with its values ranging from 0 to 1. In image segmentation tasks, the Dice coefficient is often used to measure the consistency between the predicted segmentation area and the actual segmentation area. The formula for the Dice coefficient as a loss function is shown in Equation (4):  
\[L_{dice}=1-\frac{2|X\cap Y|}{|X|+|Y|} \tag{4}\]  
In the formula, \(X\) is the predicted image generated by the model, \(Y\) is the true label of the input image, \(|X|\) represents the number of pixels in the predicted image, \(|Y|\) represents the number of pixels in the true label, and \(|X\cap Y|\) represents the intersection between the predicted image and the true label. The Dice loss function is robust to imbalanced sample problems and can balance the issue of sample imbalance. This is particularly relevant for road extraction tasks where there is a significant imbalance between positive and negative samples. In such cases, if only pixel-level cross-entropy loss is used, the model may be biased towards predicting the class with more samples. The Dice loss function can mitigate this problem to a certain extent. Finally, in this experiment, the cross-entropy loss and the Dice coefficient loss were combined by adding the two losses together as the loss function of this experiment, which is shown in Equation (5):  
\[L_{loss}=L_{BCE}+L_{dice} \tag{5}\]  
The binary cross-entropy (BCE) loss and Dice loss are complementary to each other to a certain extent. In the context of road extraction tasks, implementing this novel loss function considers optimizing the substantial amount of background pixels via the BCE loss. Simultaneously, it acknowledges the spatial relationship between positive and negative samples as indicated by the Dice loss, thus effectively handling the issue of imbalanced samples. In the early stages of prediction, when the discrepancy between the predicted result and the true label is significant, the BCE loss can provide a considerable gradient to help the model converge rapidly. As the prediction approaches the actual label, the gradient of BCE loss diminishes.