Skip to Content
You are currently on the new version of our website. Access the old version .
  • Feature Paper
  • Article
  • Open Access

14 June 2026

21 Pages

A Controllable Hill-Shading Method Based on Hierarchical Terrain Structure Priors

,
,
,
,
and
1
School of Resources and Environmental Sciences, Wuhan University, Wuhan 430079, China
2
School of Geography and Information Engineering, China University of Geosciences, Wuhan 430074, China
*
Author to whom correspondence should be addressed.

Abstract

Hill-shading, also referred to as relief shading, is an important visualization method in small- and medium-scale topographic mapping. Although analytical hill-shading methods offer high generation efficiency, they often suffer from terrain detail overload. Some deep learning generative models have introduced terrain priors, but they still have deficiencies in the controllable representation and reasonable simplification of terrain structures. This study proposes a Swiss-style hill-shading method based on hierarchical terrain structure lines. By introducing ridgelines with hierarchical semantics as priors, a synergistic regulation mechanism of enhancement and suppression is constructed to emphasize major terrain structures while moderately weakening secondary details. The model adopts a hybrid architecture integrating a Transformer encoder and a convolutional decoder to model global terrain structures. In the testing phase, by adjusting the combinations of different levels of ridgelines, the controllable adjustment of the level of detail and structural significance in hill-shading representation is realized. Multi-region experimental results show that the proposed method can generate hill-shading results with clear structural hierarchies and distinct primary–secondary relationships. Compared with other models, the proposed method demonstrates more stable performance in achieving reasonable hierarchical representation of terrain structures and detail simplification, approaching the visual style of Swiss-style manual hill-shading.

1. Introduction

Hill-shading represents terrain undulations by simulating light and shadow relationships, serving as a core cartographic technique to enhance the readability of map spatial structures. Swiss-style manual hill-shading is renowned for combining scientific accuracy with artistic expressiveness, and is considered a classic paradigm in the field of hill-shading representation [1,2]. Imhof pointed out that effective hill-shading relies on the coordinated representation of multi-scale terrain details and shadow tones, which together create a clear and natural three-dimensional impression [3]. In this context, Swiss-style hill-shading is not limited to geometric illumination simulation, but also reflects the cartographic organization of terrain structures. Previous studies have shown that it generally involves local adjustment of illumination and brightness, enhanced contrast along major ridges and valleys, and scale-adapted terrain generalization, so that the main geomorphic skeleton can be clearly perceived while excessive local details are reduced [4,5]. However, the production of Swiss-style manual hill-shading relies highly on the professional experience, terrain interpretation ability, and artistic skills of cartographers, resulting in inherent limitations such as low efficiency and difficulty in large-scale reproduction.
Existing automated hill-shading methods mainly include analytical hill-shading and deep learning-based generative methods. Analytical hill-shading usually generates shadow effects based on the geometric relationship between slope, aspect, and illumination direction, with the advantages of high computational efficiency and good light–dark contrast [6,7]. However, due to the lack of perceptual capability for terrain structure semantics, it easily produces problems such as the accumulation of fragmented details and blurred main ridges at small scales [8], especially under complex terrain and small-scale conditions, where this problem is more prominent. In recent years, deep learning methods have been introduced into the hill-shading task through end-to-end mapping, improving the quality of hill-shading in terms of visual style and detail representation [4,9,10]. Relevant research indicates that the hill-shading results generated based on deep learning methods exhibit greater proximity to manual hill-shading in overall appearance and artistic style. However, existing methods mostly center on pixel-level mapping and mainly rely on the network’s implicit learning of training samples, lacking explicit modeling of terrain structure semantics. Their generated results often have difficulty maintaining consistent structural representation logic across different terrain regions and under different scale conditions.
From the perspective of topographic mapping, terrain structure lines are important expressive elements for depicting the overall morphology and spatial organization of the terrain. The goal of hill-shading is not simply to pursue pixel-level data fidelity, but also to consider whether the terrain structure is reasonably represented. Based on this understanding, some studies have attempted to introduce topographic feature lines such as ridgelines or valley lines as prior information into generative models [5,11], thereby enhancing the network’s focus on terrain structural regions. Relevant studies indicate that explicitly incorporating structural priors improves the structural consistency and overall sense of hierarchy in hill-shading results. However, existing methods mostly remain at the level of geometric constraints or auxiliary inputs for feature lines, with limited capabilities for modeling hierarchical semantics and controlling the expressive roles of structural lines. Consequently, they struggle to differentiate the expressive intensity of terrain structures at different scales under small-scale conditions, thereby hindering the achievement of reasonable terrain simplification.
To address the problem that existing hill-shading methods find it difficult to balance terrain structure representation and detail simplification under small- and medium-scale conditions, this study proposes a Swiss-style hill-shading method based on hierarchical terrain structure priors. Different from previous approaches that mainly use terrain feature lines as undifferentiated auxiliary constraints, this study introduces ridgelines with hierarchical semantics into the generation process and assigns them different cartographic roles through enhancement and suppression channels. The enhancement channel guides the model to preserve and emphasize the main geomorphic skeleton, while the suppression channel is used to moderately weaken secondary terrain details with lower cartographic significance. To achieve this goal, this study adopts a hybrid network architecture integrating a Swin Transformer encoder and a convolutional decoder to model terrain structure information while maintaining the continuity of overall slope aspects. In the testing phase, the level of detail and structural significance of hill-shading can be controllably adjusted through different hierarchical combinations of ridgelines.
The rest of this paper is organized as follows. Section 2 reviews related studies on manual hill-shading, analytical hill-shading, deep learning-based hill-shading, and terrain structure constraints. Section 3 introduces the study data, the construction of hierarchical ridgeline priors, the proposed SG-Swin-CNN network, and the experimental settings. Section 4 presents the experimental results and analysis, including hyperparameter sensitivity, input configuration comparison, and cross-regional generalization performance. Section 5 summarizes the conclusions, discusses how the proposed method preserves the main characteristics of Swiss-style hill-shading, and outlines the limitations and future work.

3. Materials and Methods

3.1. Data and Preprocessing

3.1.1. Training Area and Data

This study takes typical mountainous terrain as the research object and selects Switzerland and its surrounding areas as the training data region. The geographical scope of the study area is between 6°48′ E to 11°19′ E and 45°19′ N to 47°10′ N, with elevations ranging from 12 to 4783 m. The terrain undulation in this area is prominent, and the ridge and valley structures are well-developed. The region exhibits a clearly defined hierarchical topographic structure, making it suitable as a training sample for the model to learn terrain structure representation and hill-shading generalization patterns. The spatial location and extent of the training area are shown in Figure 1.
Figure 1. Training area.
The reference shaded relief maps used in this study were derived from the 1:500,000 scale manual shaded relief products produced by Switzerland’s national mapping agency, Swisstopo. The DEM data were acquired from the Shuttle Radar Topography Mission (SRTM) via the Google Earth Engine platform. To ensure strict spatial alignment, all multi-source data were uniformly projected to the CH1903+/LV95 coordinate system. Additionally, considering the inherent discrepancy in spatial resolution between the original DEM and the manual shading products, both datasets were resampled to a uniform resolution of 50 m to satisfy the deep learning network’s requirement for precise spatial matching between input and output data. The corresponding DEM and manual shading data for the training area are illustrated in Figure 2.
Figure 2. Training area data. (a) 50 m resolution DEM data; (b) Swiss-style manual shading at a scale of 1:500,000.

3.1.2. Test Data

In this study, four mountainous regions were selected as test data, designated as TA1, TA2, TA3, and TA4, respectively. Among them, TA1 and TA2 are located near the training area, serving to evaluate the generalization performance of the model under adjacent geomorphic conditions; TA3 and TA4 are located in the surrounding areas of the Yin Mountains and the Himalayas, whose geomorphic types, elevation undulations, and target hill-shading scales are different from those of the training area. They are used to evaluate the model’s cross-regional generalization capability and scale adaptability. The geographical extent, elevation distribution, and corresponding target manual hill-shading scales of each test region are shown in Table 1, and the topographic context of the four test areas is illustrated in Figure 3.
Table 1. Test areas and target hill-shading scales.
Figure 3. Color-coded hypsometric maps of the four test areas. The panels show the elevation variation and local terrain characteristics of TA1, TA2, TA3, and TA4.

3.1.3. Ridgeline Extraction and Hierarchical Classification

To explicitly introduce terrain structure priors with hierarchical semantics in the experiment and realize controllable adjustment of the terrain simplification during the testing phase, this study first extracts ridgelines based on the digital elevation model as terrain skeleton constraints. The DEM derivative processing was conducted in ArcGIS 10.8 using the Hydrology tools in the Spatial Analyst toolbox. The main workflow included DEM inversion, depression filling, flow direction calculation, flow accumulation calculation, and the extraction of initial ridgelines based on a minimum flow accumulation threshold.
Based on the initial extraction results, to ensure the consistency of ridgelines in spatial connectivity and geomorphic semantics, limited manual corrections were performed on local areas with obvious noise or topological anomalies, focusing on eliminating spurious branches or disconnected line segments that defied geomorphic logic. Through these steps, a set of basic ridgeline data was obtained that exhibits considerable consistency in both spatial positioning and geomorphic semantics, as shown in Figure 4a. This provides reliable input for the hierarchical representation of terrain structures in subsequent experiments.
Figure 4. Hierarchically processed ridgelines. (a) Ridgelines prior to classification; (b) ridgelines following classification.
Considering that geomorphic elements at different scales play different roles in hill-shading representation, high-level ridgelines primarily correspond to main ridge structures controlling geomorphic patterns at regional scales, while low-level ridgelines more reflect local terrain undulations and secondary geomorphic units. This study further conducted a hierarchical classification of the ridgelines. Given that the geometric length of ridgeline segments can reflect, to some extent, their controlling scale and structural significance within geomorphic units, a length quantile classification method was adopted to divide the ridgeline network into three levels. Specifically, the top 20% longest segments were classified as first-level ridgelines. This threshold was used as an empirical quantile-based criterion to identify the relatively longest and most continuous ridgeline segments, which generally correspond to the principal terrain skeletons at the macro-scale. The threshold was not intended to define an absolute geomorphic boundary, but to construct a stable hierarchical prior for distinguishing major terrain structures from secondary local branches. Segments falling within the 20% to 40% range were designated as second-level ridgelines, reflecting geomorphic transitional structures at the meso-scale. The remaining line segments were classified as third-level ridgelines, primarily corresponding to local terrain undulations and micro-geomorphic units. The same quantile criterion was applied to all the test regions in this study, without per-region parameter tuning.
Through the above hierarchical processing, a set of ridgeline structures with hierarchical semantics was constructed, as illustrated using the TA1 region as an example in Figure 4b. This provides multi-scale structural priors for the subsequent construction of enhancement and suppression channels. In the testing phase, by flexibly configuring combinations of different levels of ridgelines in the enhancement and suppression channels, the model can regulate the significance and detail simplification degree of the generated hill-shading results while maintaining overall geomorphic consistency.

3.2. Network Architecture

3.2.1. Swin Transformer Baseline

As one of the first Transformer architectures applied to vision tasks, Vision Transformer (ViT) enables the application of self-attention mechanisms by dividing images into fixed-size patches and serializing them [31]. However, due to their reliance on global attention, ViTs incur excessively high computational complexity when processing high-resolution terrain raster data and face challenges in preserving local slope details. Therefore, this study selects the Swin Transformer, which combines global perception with local detail preservation capabilities, as the foundational feature encoding network.
The network architecture of the Swin Transformer is shown in Figure 5, where Figure 5a illustrates the hierarchical encoding process of the model, and Figure 5b shows the internal structure of two successive Transformer Blocks. The model adopts a hierarchical encoding approach, converting the input raster into token representations through Patch Partition and Linear Embedding. Subsequently, in successive encoding stages, it updates features using window multi-head self-attention (W-MSA), shifted window multi-head self-attention (SW-MSA), and a multilayer perceptron (MLP). This mechanism enables the features to progressively acquire structural perception capabilities at larger scales, significantly improving computational efficiency while maintaining multi-scale feature representation. During the encoding process, the model employs Patch Merging operations to gradually reduce the spatial resolution of the features while elevating their semantic abstraction levels. This facilitates a smooth transition in feature representation from local details to regional-scale structural information. This hierarchical feature representation lays a solid foundation for multi-scale feature utilization in the subsequent network architecture.
Figure 5. The model architecture of the Swin Transformer network.

3.2.2. SG-Swin-CNN Network Architecture

Hill-shading is a continuous field reconstruction problem, which requires not only the preservation of overall topographical consistency but also the maintenance of continuous and natural light–dark transitions within slopes. Based on the aforementioned Swin Transformer architecture, this study improves and designs the network in combination with the requirements of terrain structure representation, constructing a hybrid architecture model (Structure-Guided Swin-CNN, hereinafter referred to as SG-Swin-CNN) that integrates a Swin Transformer encoder and a convolutional decoder. The overall architecture is shown in Figure 6.
Figure 6. SG-Swin-CNN network architecture diagram. The arrows in the figure indicate the direction of data or feature flow.
SG-Swin-CNN adopts an encoder–decoder network architecture. The model input is jointly composed of a digital elevation model (DEM) and its corresponding enhancement and suppression structural information. First, the input data is converted into token representations and fed into the Swin Transformer encoder. During the encoding phase, multi-level Swin Blocks and Patch Merging operations progressively extract terrain structural features with multi-scale contextual information, characterizing the spatial organization of terrain frameworks at regional scales. The high-level features output by the encoder are input into the convolutional decoder after feature mapping and channel adjustment via projection and residual blocks. The decoding stage employs a stepwise upsampling structure to gradually restore the spatial resolution, and fuses multi-scale feature information from the encoding stage through skip connections at corresponding scales. This enables the network to express information such as light and dark variations within slopes more stably while maintaining global structural consistency.
At the end of the decoder, this study further introduces a Mask-Guided Feature Modulation module. This module fuses the enhancement and suppression structural information at the feature level to perform differential regulation on different terrain regions, keeping the terrain skeleton regions clear and stable, while moderately smoothing secondary slope details without compromising the overall light and dark relationships. Through the above design, SG-Swin-CNN can generate hill-shading results with good structural consistency and continuous, natural slope shading.

3.2.3. Hierarchical Regulation Strategy of SG-Swin-CNN

Based on the above network architecture, this study further introduces a regulation mechanism based on hierarchical ridgelines to achieve controllable adjustment of structural significance and detail simplification in hill-shading representation. Through the synergistic effect of the enhancement channel and the suppression channel, this mechanism maps the semantic information of hierarchical ridgelines into structural guidance and detail suppression for the hill-shading process, thereby achieving controllable adjustment of the terrain expression priorities during the testing phase.
Specifically, the enhancement channel and suppression channel respectively correspond to two types of terrain structure information generated by different extraction thresholds. The enhancement channel corresponds to ridgelines extracted under higher threshold conditions. Such ridgelines exhibit strong spatial stability and continuity, possessing clear geomorphic control significance, and are used to represent the primary terrain skeletons at regional scales. The suppression channel, conversely, comprises finer ridgelines extracted under lower threshold conditions, corresponding to secondary terrain elements with lower cartographic significance at the target scale.
By flexibly configuring combinations of different levels of ridgelines in the enhancement and suppression channels during the testing phase, the proposed method can achieve hierarchical regulation of hill-shading structural significance and expression detail levels without altering the network architecture or training parameters. This provides a unified, controllable, and highly scalable technical framework for hill-shading under different cartographic scales and expression needs.

3.3. Experimental Settings

All experiments in this study were completed in a unified computational environment. The experimental platform was equipped with an Intel Core i5-14600KF processor, Intel Corporation, Santa Clara, CA, USA, and 64 GB of system memory. Both model training and testing were performed on an NVIDIA GeForce RTX 4080 GPU, NVIDIA Corporation, Santa Clara, CA, USA. The deep learning models were implemented using PyTorch 2.1.2 with CUDA 11.8, and all experiments were run under the same software and hardware conditions to ensure the comparability and reproducibility of the experimental results.
During the training phase, both the parameter exploration experiments and the final multi-region comparison experiments were conducted for 200 epochs to ensure that the models converged fully. For hyperparameter selection, the control variable method was adopted to systematically explore key parameters in a single region while maintaining all other conditions unchanged. By comprehensively analyzing the model performance under different parameter configurations, the learning rate was ultimately determined to be 2 × 10 − 4 , and the Swin Transformer window size was set to 4.

4. Results and Discussion

4.1. Hyperparameter Sensitivity Analysis

To determine a reasonable model configuration and avoid the randomness of parameter selection, this study selected region TA1 and region TA3 as representative test regions. An analysis was conducted on two parameters: the learning rate and the Swin Transformer window size, while all other model parameters were kept identical. Given that the reference hill-shading map for region TA3 was derived from printed book illustrations, making reliable pixel-level quantitative evaluation difficult, this region is only used for visual qualitative analysis.
Model performance evaluation was conducted using a combination of quantitative and qualitative methods. The quantitative evaluation metrics selected were Root Mean Square Error (RMSE) and Structural Similarity Index (SSIM). RMSE measures the overall grayscale error level between the generated hill-shading and the reference hill-shading, reflecting the model’s consistency in overall brightness distribution, with its calculation method shown in Equation (1). SSIM characterizes the similarity between images from three aspects, brightness, contrast, and structure, focusing more on the consistency of local terrain structure representation, as calculated by Equation (2). The qualitative analysis is mainly based on the visual analysis of the generated results, focusing on the coherence of terrain structures, the rationality of hierarchical expression, and the naturalness of local details.
R M S E = 1 M N ∑ i = 1 M ∑ j = 1 N I i j − R i j 2
where I i j and R i j respectively represent the pixel values at position ( i , j ) of the generated hill-shading map I and the reference hill-shading map R .
S S I M I , R = ( 2 μ I μ R + C 1 ) ( 2 σ I R + C 2 ) ( μ I 2 + μ R 2 + C 1 ) ( σ I 2 + σ R 2 + C 2 )
where μ I and μ R respectively represent the local means of the generated hill-shading map I and the reference hill-shading map R ; σ I 2 and σ R 2 represent their local variances; σ I R represents their covariance; and C 1 and C 2 are stabilization constants used to avoid a zero denominator.
It should be noted that the research objective of this study is not pixel-level restoration of the reference hill-shading, but rather to achieve a cartographic representation with reasonable terrain structure, clear hierarchy, and controllability. Therefore, in the parameter sensitivity analysis, quantitative metrics are primarily employed to facilitate comparative assessments of relative performance differences across various parameter configurations, and the final parameter selection still requires a comprehensive evaluation based on the visual effect of the generated hill-shading maps.

4.1.1. Exploration of Learning Rate

Under conditions where other parameters remained unchanged, comparative experiments were conducted on different learning rate settings. The quantitative evaluation results for region TA1 are shown in Table 2. The experimental results show that when the learning rate is set to 1 × 10 − 5 , the model exhibits suboptimal performance on both the RMSE and SSIM metrics, suggesting that an excessively low learning rate may lead to insufficient model convergence. Conversely, increasing the learning rate to 1 × 10 − 3 results in a decline in model performance, indicating that an overly high learning rate may adversely affect training stability.
Table 2. Quantitative comparison of different learning rates on region TA1, with bold values representing the best performance. The arrows in the table indicate the preferred direction of each metric: lower RMSE values are better, whereas higher SSIM values are better.
In contrast, the setting of 2 × 10 − 4 achieved the optimal results on both metrics, indicating that it strikes a relatively reasonable balance between model convergence efficiency and training stability. Comprehensively considering model performance and training stability, this study selects a learning rate of 2 × 10 − 4 as the default setting for subsequent experiments.
It is worth noting that although SSIM values are generally at a medium level under different learning rates, their variation trends reflect relative differences in the model in local terrain representation, thus still holding certain reference value in parameter selection.

4.1.2. Exploration of Window Size

Under the premise of a fixed learning rate of 2 × 10 − 4 and with all other model structural parameters held constant, this study further analyzed the impact of different Swin Transformer window sizes on model performance and terrain representation. The window size constrains the spatial perception range of self-attention, which may subsequently affect the expression scale of terrain structures in the generated hill-shading and the presentation of light and dark hierarchies on slopes.
The quantitative evaluation results for region TA1 are shown in Table 3. The model exhibits no significant differences in overall error levels or local structural consistency across varying window sizes. This indicates that under the conditions of this region, quantitative metrics based on pixel-level error demonstrate limited sensitivity to changes in window size.
Table 3. Quantitative comparison of different Swin Transformer window sizes on region TA1. The arrows in the table indicate the preferred direction of each metric: lower RMSE values are better, whereas higher SSIM values are better.
Further combining the hill-shading results of region TA1 and region TA3 for visual analysis, the results are shown in Figure 7 and Figure 8. It can be observed that the generated results under different window sizes show little difference in the overall terrain structural pattern, but there are visible differences in local slope shadow morphology and detail hierarchies. Specifically, when the window is larger, the perception range of self-attention expands, and the light and dark variations on the slopes are relatively gentle. When the window is smaller, the model is more inclined to enhance local details and high-frequency shadow variations, making the light and dark performance of the slopes somewhat unnatural (as shown in the red boxes in Figure 7 and Figure 8). In contrast, the window size of 4 strikes a favorable balance between maintaining slope shadow continuity and expressing detail levels across both regions, yielding a relatively stable overall visual effect.
Figure 7. Qualitative comparison of different Swin Transformer window sizes on region TA1. (a) window_size = 8; (b) window_size = 4; (c) window_size = 2. Red boxes indicate the key regions for comparison. The topographic context of TA1 is provided in Figure 3.
Figure 8. Qualitative comparison of different Swin Transformer window sizes on region TA3. (a) window_size = 8; (b) window_size = 4; (c) window_size = 2. Red boxes indicate the key regions for comparison. The topographic context of TA3 is provided in Figure 3.
Therefore, based on the quantitative evaluation of region TA1 and the qualitative analysis of both the TA1 and TA3 regions, a window size of 4 was selected as the default setting for subsequent experiments in this study.

4.2. Impact of Input Configuration on Terrain Simplification

Having established the parameter configuration, this section analyzes the output results from the perspective of input configuration variations, and conducts phased validation of the introduced suppression channel and its configuration patterns during the testing phase. Specifically, it first analyzes the necessity of introducing the suppression mechanism by comparing the generated hill-shading results under two input forms with and without the suppression channel. Building upon this, while maintaining the three-channel input configuration, it further explores the model’s regulatory effect on terrain simplification and structural hierarchical expression by adjusting the configuration of different levels of ridgelines in the enhancement and suppression channels. The experiments select region TA1 and TA3, which have differences in geographical location and terrain complexity, for comparative analysis to examine the adaptability and stability of the proposed method under different terrain conditions.

4.2.1. Necessity Analysis of Introducing the Suppression Channel

To validate the role of the suppression mechanism in terrain structure representation, this study first compared the generated hill-shading results under two input configurations in the TA1 and TA3 regions: a two-channel input containing only enhancement information, and a three-channel input introducing both enhancement and suppression information simultaneously. The comparison results are shown in Figure 9.
Figure 9. Comparison of hill-shading results under different input configurations. (a) Two-channel input (DEM + Enh); (b) three-channel input (DEM + Enh + Sup). The top row depicts the TA1 region, while the bottom row shows the TA3 region. The red boxes highlight regions where the generated results exhibit more pronounced differences between the two configurations. The topographic context of TA1 and TA3 is provided in Figure 3.
In region TA1, the hill-shading results generated under both input configurations exhibit considerable consistency in terms of overall terrain structure continuity and the morphology of principal ridgelines, both reflecting the terrain skeleton features at the regional scale well. From a local perspective, the three-channel results after introducing the suppression mechanism are smoother and more natural in light and dark transitions and slope representations, but the overall difference is not significant. This indicates that in areas where terrain details are relatively sparse, the impact of the suppression mechanism on the overall hill-shading structure is relatively limited.
In contrast, within the TA3 region characterized by frequent terrain undulations and denser fine-scale structures, the hill-shading results under the two input configurations present more pronounced differences, primarily reflected in the overall light and dark contrast and shadow performance. Under the two-channel input condition utilizing only enhancement information, the light and dark contrast on the slopes is relatively weak, the hierarchy of shadow areas is shallow, and the boundaries between light and dark of some ridges and valleys are not prominent enough, resulting in insufficient effect of the terrain undulations. Conversely, the results after introducing the suppression channel have clearer light and dark hierarchies on the slopes, making the main terrain structures more prominent in the overall representation, and the terrain hierarchical relationships clearer.
Synthesizing the comparison results of the two regions, it can be seen that the suppression mechanism plays a positive role in suppressing fine-scale slope undulations and adjusting slope light and dark variations, and its impact on the hill-shading results varies depending on the degree of terrain detail manifestation.

4.2.2. Terrain Simplification Effects Under Different Configuration Modes

Building on verifying the necessity of introducing the suppression mechanism, this study further analyzes the impact of the allocation methods of different levels of ridgelines in the enhancement and suppression channels during the testing phase on the terrain simplification effect. This was conducted under the premise of a fixed three-channel input configuration. Specifically, by adjusting how different levels of ridgelines participate in the enhancement and suppression channels, three input configuration patterns were constructed, Enh123, Enh12, and Enh1, and the hill-shading results were comparatively analyzed in the TA1 and TA3 regions, with the results shown in Figure 10.
Figure 10. Comparison of hill-shading results under different input configuration modes during the testing phase (the Enh123 mode denotes that ridgelines of levels 1, 2, and 3 all enter the enhancement channel, while the Enh1 mode indicates that only the ridgelines of level 1 enter the enhancement channel, with levels 2 and 3 entering the suppression channel). (a) Enh123; (b) Enh12; (c) Enh1. The first row depicts the TA1 region, and the second row depicts the TA3 region. Red and purple boxes indicate areas with more pronounced differences in generation results, while green boxes highlight regions where structural continuity is compromised under excessive suppression conditions.
In Enh123 mode, ridgelines of all levels participate in the enhancement channel as structural reinforcement information, and the model output is mainly dominated by the enhancement channel. The generated results show relatively complete terrain skeletons and clear hierarchical relationships in both the TA1 and TA3 regions, and the overall terrain structure continuity is good, which can be regarded as a complete presentation of terrain structures at the target scale.
When the Enh12 mode is adopted, the lowest-level ridgelines no longer play the role of structural reinforcement, but are introduced into the suppression channel to suppress terrain details at the corresponding scale. Under this configuration, the suppression mechanism begins to exert a terrain simplification effect, enabling the hill-shading results to effectively weaken local textures while maintaining the prominence of main terrain features, making the primary and secondary relationships in terrain expression clearer.
When higher-level ridgelines are further introduced to the suppression channel, retaining only the most primary first-level structures as enhancement information, the degree of detail suppression is significantly enhanced. However, along with the continuous weakening of details, some ridge features that were originally used to support regional-scale structures are also weakened together, causing the overall terrain hierarchy to become flat and structural continuity to be compromised (as indicated by the green boxes in Figure 10).
Synthesizing the comparison results under the three configuration modes, it can be seen that by adjusting the participation modes of different levels of ridgelines in the enhancement and suppression channels, the model can achieve effective regulation of the degree of terrain simplification during the testing phase. However, there is a reasonable range for this regulation process. When ridgelines supporting the overall terrain skeleton at the target scale are incorporated into the suppression channel, the overall terrain representation will inevitably be weakened. This demonstrates that terrain simplification relies on a reasonable level allocation strategy.

4.3. Generalization Performance of SG-Swin-CNN

In the aforementioned experiments, this study has demonstrated that the proposed model possesses stable structural representation capabilities when introducing terrain structure priors. To further evaluate the generalization performance of this approach, multi-network comparative experiments were conducted on the four test regions (TA1-TA4) introduced in Section 3.1.2. Then the proposed method was comparatively analyzed with two neural network models commonly used for hill-shading tasks, U-Net [4] and ResUNet [9]. It should be noted that the reference hill-shading maps for the TA1 and TA2 regions were derived from standard Swiss shaded relief map products produced by Swisstopo, whereas the reference hill-shading maps for the TA3 and TA4 regions were obtained from scanned illustrations in Shi’s monograph Relief Shading Method [32]. These reference maps were georeferenced and used mainly for visual comparative analysis.
To prevent different terrain simplification strategies from interfering with the experimental results, all comparative experiments in this section were conducted under a unified input configuration. Specifically, the hill-shading results for the four regions TA1-TA4 were all generated using the Enh123 mode, wherein ridgelines of all levels participated in the testing as enhancement information. Therefore, the experimental results in this section mainly reflect the hill-shading capabilities of different network models under the constraint of complete terrain structures. The comparison results for each test region are shown in Figure 11.
Figure 11. Comparison of hill-shading results across four test regions (TA1–TA4) for different networks. Red boxes indicate areas where differences are relatively pronounced. The color-coded hypsometric maps of TA1 to TA4 are provided in Figure 3.
From the overall results, in the TA1 and TA2 regions located near the training area, all three network methods can reproduce the main terrain morphology within the regions well, and the overall terrain structure representation is relatively complete. However, observing the local slope performance, the hill-shading results generated by U-Net and ResUNet show a more obvious response to fine-scale undulations within the slopes; the light and dark variations in local areas are relatively dense, and the primary and secondary hierarchies of terrain structures are weakened to a certain extent. In contrast, the results generated by the proposed method maintain the clarity of main terrain features while achieving more coherent light and dark transitions within the slopes, maintaining relatively stable terrain hierarchical relationships.
In the TA3 and TA4 regions, which have more complex terrain structures and are far from the training area, the differences between the different methods are further amplified. As can be seen from the comparison results in Figure 11, the responses of U-Net and ResUNet to slope details are further enhanced in these two areas, with denser light and dark variations in the generated results, causing the overall terrain expression to present a high level of detail complexity, and relatively weakening the primary and secondary relationships between local structures. In contrast, the proposed method can still better maintain the continuity of main terrain structures in the TA3 and TA4 regions, the overall terrain morphology is more concentrated, and the organizational form of the ridge structures is clearer, making the terrain representation under complex geomorphic conditions more holistic and readable.
Synthesizing the comparative results of the four test areas, it can be seen that under a unified input configuration, different network models exhibit differences in terrain structure representation in hill-shading tasks. Compared to U-Net and ResUNet, the proposed method demonstrates relatively stable structural organization capabilities under different geomorphic backgrounds and scale conditions, and is capable of maintaining consistent terrain hierarchical expression in complex terrain regions.

5. Conclusions

Focusing on the issues of terrain structure expression and detail simplification in hill-shading cartography, this study proposed a controllable hill-shading method driven by hierarchical structure priors. Within the deep learning hill-shading framework, this method explicitly introduces hierarchical ridgelines as structural priors, and regulates the expressive roles of different levels of ridgelines through enhancement and suppression channels, realizing the end-to-end generation and structural significance regulation of Swiss-style hill-shading. The experimental results show that the proposed method can relatively stably maintain the continuity of the overall terrain hierarchy and main structures in mountainous geomorphic regions of varying complexities, and on this basis, achieve the reasonable weakening of secondary terrain details. This provides a feasible implementation method for structural representation and terrain simplification in small- and medium-scale hill-shading cartography. The results further indicate that the proposed method preserves several key characteristics of Swiss-style hill-shading. The hierarchical ridgeline priors maintain the continuity and prominence of major geomorphic skeletons, while the enhancement and suppression channels respectively strengthen primary terrain structures and moderately weaken secondary local details. As a result, the generated hill-shading improves the primary–secondary hierarchy of terrain structures, reduces excessive local details, and retains a clear three-dimensional impression.
From the perspective of network structure, the Transformer encoder introduced in this study effectively enhances the model’s capability to model global terrain contexts during the hill-shading process. Compared with convolution-dominated baseline networks, this structure is more conducive to capturing the overall spatial orientation relationships of linear terrain elements such as ridgelines, thereby reducing the impact of local slope disturbances on the structural continuity of the main terrain skeletons. The experimental results demonstrate that this global structural modeling capability enables the model to more readily maintain the continuity and overall consistency of the main terrain structure, providing a stable foundation for subsequent expression regulation based on hierarchical structure priors.
In terms of structural prior regulation, this study achieved hierarchical adjustment of the level of detail in hill-shading representation by adjusting the allocation modes of different levels of ridgelines in the enhancement and suppression channels during the testing phase. Without the need to retrain the model, this strategy enables moderate simplification of certain secondary structures while preserving the main terrain structures as clearly distinguishable, demonstrating the feasibility and cartographic value of using hierarchical structure priors in hill-shading representation control. It should be noted that the suppression regulation of terrain structures has a certain upper limit, and its effectiveness depends on the overall terrain features and structural hierarchical distribution of the region. When ridgelines serving in the role of supporting the overall terrain representation at the target scale are included in the suppression scope, the overall effect of the hill-shading results will be weakened. Consequently, expression regulation based on hierarchical structure priors needs to be reasonably configured according to the terrain background, rather than achieving terrain simplification by simply increasing the suppression intensity.
Although the proposed method has demonstrated the effectiveness of hierarchical structure priors and the suppression mechanism in hill-shading structural representation and detail simplification through multi-region experiments, certain limitations remain. This study mainly analyzed the influence of the suppression mechanism on hill-shading results by comparing different hierarchical configurations, but the related conclusions are still primarily based on qualitative analysis and have not systematically characterized the relationship between the degree of suppression and hill-shading response from a quantitative perspective. Furthermore, although the hierarchical ridgelines are classified using a uniform quantile-based rule, the current configuration modes of hierarchical structures in the enhancement and suppression channels still incorporate expert-guided judgment when determining an appropriate level of detail for different cartographic purposes. In addition, limited expert intervention is used to improve the topological consistency and geomorphic rationality of the extracted ridgelines. On this basis, the proposed quantile-based classification method can be uniformly applied to construct hierarchical structure priors, and the experimental results across the test regions demonstrate its effectiveness under different geomorphological conditions. In regions with significant differences in terrain undulations, a single fixed configuration may not fully satisfy the hill-shading representation needs under different geomorphic conditions and target scales. Future work will further explore quantitative evaluation of the suppression effect and adaptive strategies for configuring hierarchical structure priors, with the aim of reducing manual intervention while enhancing the stability, scalability, and practical cartographic value of the method under diverse geomorphological conditions.

Author Contributions

Conceptualization, Jiawei Fan and Yue Wang; methodology, Jiawei Fan and Wenping Jiang; software, Jiawei Fan; validation, Daping Xi and Xinyue Lyu; formal analysis, Yue Wang and Yu Wang; investigation, Xinyue Lyu and Yu Wang; data curation, Yue Wang and Wenping Jiang; writing, original draft preparation, Jiawei Fan; writing, review and editing, Jiawei Fan and Wenping Jiang; visualization, Xinyue Lyu; supervision, Daping Xi; project administration, Wenping Jiang and Daping Xi; funding acquisition, Wenping Jiang. All authors have read and agreed to the published version of the manuscript.

Funding

This research was financially supported by the National Key Research and Development Program of China [grant number 2022YFB3904100]; the National Natural Science Foundation of China [grant number 42571515 and 41371428]; and LIESMARS Special Research Funding.

Data Availability Statement

The training DEM and test DEM used in this study were downloaded from Google Earth Engine, accessible at https://earthengine.google.com/ (accessed on 15 March 2026). The Swiss-shaded relief maps used as the training set in this study were purchased from the Swisstopo website, accessible at https://shop.swisstopo.admin.ch/en (accessed on 15 March 2026). The code and data supporting this study are publicly available in Figshare at https://figshare.com/s/98902cf4e6643802324e (accessed on 15 March 2026).

Acknowledgments

The authors would like to sincerely thank all the reviewers for their valuable comments and constructive suggestions.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Hurni, L. Cartographic relief presentation revisited–Forty years after Eduard Imhof. In Landform-Structure, Evolution, Process Control: Proceedings of the International Symposium on Landform Organised by the Research Training Group 437; Springer: Berlin/Heidelberg, Germany, 2009; pp. 1–20. [Google Scholar]
  2. Räber, S.; Jenny, B.; Hurni, L. Swiss Style Relief Shading Methodology: Knowledge base for further development and application in digital cartography. In Proceedings of the 24th International Cartographic Conference ICC, Santiago, Chile, 15–21 November 2009; pp. 1–9. [Google Scholar]
  3. Imhof, E. CHAPTER 6. Spot Heights and Soundings. In Cartographic Relief Presentation; De Gruyter: Berlin, Germany, 1982. [Google Scholar]
  4. Jenny, B.; Heitzler, M.; Singh, D.; Farmakis-Serebryakova, M.; Liu, J.C.; Hurni, L. Cartographic relief shading with neural networks. IEEE Trans. Vis. Comput. Graph. 2020, 27, 1225–1235. [Google Scholar] [CrossRef] [Scilit]
  5. Yan, L.; Ai, T.; Gao, A. Integrating terrain structure characteristics into generative adversarial nets for hillshade generation. Int. J. Geogr. Inf. Sci. 2024, 38, 2433–2457. [Google Scholar] [CrossRef] [Scilit]
  6. Horn, B.K. Hill shading and the reflectance map. Proc. IEEE 1981, 69, 14–47. [Google Scholar] [CrossRef] [Scilit]
  7. Zakšek, K.; Oštir, K.; Kokalj, Ž. Sky-View Factor as a Relief Visualization Technique. Remote Sens. 2011, 3, 398–415. [Google Scholar] [CrossRef] [Scilit]
  8. Leonowicz, A.M.; Jenny, B. Automated small-scale relief shading: A new method and software application. Geogr. Tech. 2010, 90–95. [Google Scholar]
  9. Yin, G.; Li, S.; Ma, J.; Lü, D.; Bian, C. A hill-shading generation method based on ResUNet. Geomat. Inf. Sci. Wuhan Univ. 2023, 50, 197. [Google Scholar] [CrossRef]
  10. Jiang, W.; Wang, Y.; Ding, H.; Jiang, H.; Xi, D.; Wang, Y.; Ma, P. Construction of a small-scale relief shading neural network model based on the attention mechanism. Cartogr. Geogr. Inf. Sci. 2025, 52, 716–734. [Google Scholar] [CrossRef] [Scilit]
  11. Wang, Y.; Jiang, W.; Jiang, H.; Dai, D.; Ma, P.; Wang, Y.; Wang, Z. Construction of a neural network model for small-scale shaded relief maps constrained by topographic feature lines. Geocarto Int. 2025, 40, 2459099. [Google Scholar] [CrossRef] [Scilit]
  12. Yoeli, P. Analytical hill shading and density. Surv. Mapp. 1966, 26, 253–259. [Google Scholar]
  13. Hobbs, K.F. An investigation of RGB multi-band shading for relief visualisation. Int. J. Appl. Earth Obs. Geoinf. 1999, 1, 181–186. [Google Scholar] [CrossRef] [Scilit]
  14. Mark, R. A Multidirectional, Oblique-Weighted, Shaded-Relief Image of the Island of Hawaii (No. 92-422); US Department of the Interior: Washington, DC, USA; US Geological Survey: Reston, VA, USA, 1992. [Google Scholar]
  15. Kennelly, P.J. Terrain maps displaying hill-shading with curvature. Geomorphology 2008, 102, 567–577. [Google Scholar] [CrossRef] [Scilit]
  16. Smith, M.J.; Clark, C.D. Methods for the visualization of digital elevation models for landform mapping. Earth Surf. Processes Landf. 2005, 30, 885–900. [Google Scholar] [CrossRef] [Scilit]
  17. Jenny, B. An interactive approach to analytical relief shading. Cartogr. Int. J. Geogr. Inf. Geovis. 2001, 38, 67–75. [Google Scholar] [CrossRef] [Scilit]
  18. Marston, B.E.; Jenny, B. Improving the representation of major landforms in analytical relief shading. Int. J. Geogr. Inf. Sci. 2015, 29, 1144–1165. [Google Scholar] [CrossRef] [Scilit]
  19. Schertenleib, U. Fridolin Becker (1854–1922): Topograph, Kartograph, Innovator. Cartogr. Helv. 1997, 15, 3–10. [Google Scholar] [CrossRef] [Scilit]
  20. Ai, T.; Li, J. A DEM generalization by minor valley branch detection and grid filling. ISPRS J. Photogramm. Remote Sens. 2010, 65, 198–207. [Google Scholar] [CrossRef] [Scilit]
  21. Chen, Y.; Ma, T.; Chen, X.; Chen, Z.; Yang, C.; Lin, C.; Shan, L. A new DEM generalization method based on watershed and tree structure. PLoS ONE 2016, 11, e0159798. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  22. Chen, C.; Li, Y. An orthogonal least-square-based method for DEM generalization. Int. J. Geogr. Inf. Sci. 2013, 27, 154–167. [Google Scholar] [CrossRef] [Scilit]
  23. Shirzaei, M. A wavelet-based multitemporal DInSAR algorithm for monitoring ground surface motion. IEEE Geosci. Remote Sens. Lett. 2012, 10, 456–460. [Google Scholar] [CrossRef] [Scilit]
  24. Li, S.; Yin, G.; Ma, J.; Wen, B.; Zhou, Z. Generation method for shaded relief based on conditional generative adversarial nets. ISPRS Int. J. Geo-Inf. 2022, 11, 374. [Google Scholar] [CrossRef] [Scilit]
  25. Badrinarayanan, V.; Kendall, A.; Cipolla, R. Segnet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 2481–2495. [Google Scholar] [CrossRef] [Scilit]
  26. Chen, J.; Lu, Y.; Yu, Q.; Luo, X.; Adeli, E.; Wang, Y.; Lu, L.; Yuille, A.L.; Zhou, Y. Transunet: Transformers make strong encoders for medical image segmentation. arXiv 2021, arXiv:2102.04306. [Google Scholar] [CrossRef] [Scilit]
  27. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems (NIPS’17); Curran Associates Inc.: Red Hook, NY, USA, 2017; Volume 30. [Google Scholar]
  28. Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 10–17 October 2021; pp. 10012–10022. [Google Scholar]
  29. Jenny, B. Terrain generalization with line integral convolution. Cartogr. Geogr. Inf. Sci. 2021, 48, 78–92. [Google Scholar] [CrossRef] [Scilit]
  30. Bian, C.; Li, S.; Ma, J.; Yin, G.; Wen, B.; Kong, L. Generation and optimisation of colour-shaded relief maps using neural networks. Geocarto Int. 2024, 39, 2322085. [Google Scholar] [CrossRef] [Scilit]
  31. Dosovitskiy, A. An image is worth 16 × 16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
  32. Shi, Z. Relief Shading Method; Publishing House of Surveying and Mapping: Beijing, China, 1985. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.