Terrain segmentation method, system, device and medium for complex traffic environment
By fusing cross-level semantic representation and local structural compensation features, the accuracy and real-time performance issues of terrain segmentation in complex off-road environments are addressed, thereby improving the model's adaptability and generalization performance in complex environments.
Patent Information
- Application Number
- CN202611704894.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-30
- Publication Date
- 2026-11-27
AI Technical Summary
Existing terrain segmentation methods suffer from problems such as class confusion, boundary missegmentation, and omission of small targets in complex off-road environments, and are difficult to meet the requirements of real-time performance and lightweight design, especially in complex domain offset environments where their generalization ability is insufficient.
By utilizing a pre-trained visual foundation model for cross-level semantic representation, combined with global semantic feature aggregation and local structural compensation feature extraction, and employing adaptive weighted residual fusion technology, pixel-level classification feature maps are generated for terrain segmentation.
It improves the accuracy and real-time performance of terrain segmentation, enhances the model's generalization ability in complex domain offset environments, adapts to complex scene changes, and meets the real-time perception needs of mobile robots and other devices.
Smart Images

Figure CN123181841A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and intelligent sensing technology, and in particular to a terrain segmentation method, system, device and medium for complex traffic environments. Background Technology
[0002] With the rapid development of autonomous driving, mobile robots, and unmanned autonomous systems, terrain perception and traversable area recognition in complex environments have become important research directions in the field of intelligent visual perception. Unlike structured environments with clear road boundaries, well-defined traffic rules, and stable scene structures, off-road environments typically lack regular road morphology. Their surface types are complex and varied, including mud, grass, gravel, water accumulation, potholes, slopes, and obstacles. Furthermore, different terrains often lack clear texture boundaries and structural constraints, and traversable and impassable areas have high visual similarity, easily leading to category confusion and misjudgment. In addition, off-road environments are easily affected by weather changes, lighting conditions, seasonal changes, regional differences, and camera perspective changes, exhibiting significant scene distribution differences and dynamic changes. Especially in practical applications, the same terrain may exhibit completely different visual characteristics under different environmental conditions, while different types of terrain may present similar visual appearances, leading to serious domain shift problems for the perception system. Therefore, this type of scenario places higher demands on the global semantic understanding ability, local detail modeling ability, and cross-scene generalization ability of terrain segmentation algorithms. Meanwhile, since the relevant systems are usually deployed on vehicle platforms, mobile robots or edge computing devices, the terrain segmentation algorithm also needs to take into account the requirements of real-time performance and lightweight design in order to meet the application requirements of online perception and real-time response in complex environments, due to limitations in computing resources and power consumption.
[0003] Currently, most existing terrain semantic segmentation methods are based on convolutional neural networks (CNNs) or visual Transformers (ViT). CNN-based methods primarily utilize dilated convolutions, feature pyramids, and encoder-decoder structures to achieve multi-scale feature extraction and fusion, enhancing the representation of local textures and edge details to some extent. However, limited by the local receptive field of convolutional operations, these methods struggle to effectively model long-distance dependencies and global semantic information in complex scenes, easily leading to class confusion, boundary missegmentation, and omission of small targets in complex off-road environments. In recent years, ViT-based segmentation methods have leveraged self-attention mechanisms to establish global feature associations, demonstrating strong advantages in scene understanding and global semantic modeling. Some studies have further enhanced multi-scale feature representation capabilities by combining hierarchical Transformer structures or hybrid convolutional-Transformer architectures. However, existing ViT-based methods typically rely on supervised training on specific datasets, exhibiting strong dependence on the distribution of training data and prone to significant performance degradation when the environment changes. Meanwhile, Transformer has relatively limited ability to model local textures, edge regions, and fine-grained terrain structures. In complex off-road scenarios, it is still prone to problems such as blurred boundaries, missed detection of small-scale targets, and inaccurate detail recognition.
[0004] Furthermore, to improve segmentation accuracy, some existing methods employ complex multi-branch structures, high-resolution feature fusion strategies, or large-scale parameter models. While these methods can achieve good performance on specific test sets, their computational cost and inference latency increase significantly, making it difficult to meet the real-time perception and edge deployment requirements of unmanned systems. More importantly, existing methods generally lack specific designs for complex domain offset environments. When the training environment differs from the actual application environment due to variations in terrain type, weather, lighting, or sensor differences, the model often struggles to maintain stable segmentation performance, resulting in insufficient generalization ability.
[0005] In recent years, visual foundation models have gained stronger general visual representation capabilities through self-supervised pre-training on large-scale image data, demonstrating excellent generalization performance in cross-scene visual understanding tasks and providing a new technical approach to solving terrain segmentation problems in complex domain offset environments. However, existing visual foundation models still suffer from insufficient local detail perception, inaccurate small-scale target recognition, and limited ability to model complex surface textures in off-road terrain segmentation tasks.
[0006] Therefore, how to fully utilize the cross-scene representation capabilities of basic visual models while enhancing their ability to perceive local details and terrain structure information, and construct a terrain segmentation method that combines high precision, high real-time performance, and strong generalization ability, has become an important technical problem that urgently needs to be solved in the field of intelligent visual perception. Summary of the Invention
[0007] This invention provides a terrain segmentation method, system, device, and medium for complex traffic environments, with the main objective of solving the problem of poor terrain segmentation accuracy.
[0008] To achieve the above objectives, this invention provides a terrain segmentation method for complex traffic environments, comprising: acquiring an environmental terrain map; performing cross-level semantic representation of the environmental terrain map using a visual base model obtained through secondary training based on pre-training to obtain global semantic features; selecting two sets of target semantic features from different network levels from the global semantic features and aggregating them to obtain aggregated global features; using a preset local structure compensation feature module to perform two-stage local feature extraction on the environmental terrain map to obtain local structure compensation features; performing adaptive weighted residual fusion of the aggregated global features and the local structure compensation features to obtain fused features; and generating a pixel-level classification feature map corresponding to the fused features for terrain segmentation.
[0009] This invention also provides a terrain segmentation system for complex traffic environments. The system includes: a global semantic feature extraction module for acquiring an environmental terrain map and performing cross-level semantic representation on the environmental terrain map using a visual base model obtained through secondary training based on pre-training, to obtain global semantic features; a global semantic aggregation module for selecting two sets of target semantic features from different network layers of the global semantic features and aggregating them to obtain aggregated global features; a local structure compensation feature extraction module for performing two-stage local feature extraction on the environmental terrain map using a preset local structure compensation feature module, to obtain local structure compensation features; and a semantic structure collaborative fusion module for adaptively weighted residual fusion of the aggregated global features and the local structure compensation features to obtain fused features. The system performs adaptive weighted residual fusion of aggregated global features and local structure compensation features to obtain fused features. This includes: aligning aggregated global features and local structure compensation features using bilinear interpolation to obtain aligned features corresponding to the aggregated global features; concatenating the aligned features with the local structure compensation features to obtain concatenated features; generating an adaptive weight matrix based on the concatenated features using a preset weight matrix generation formula; adjusting the local structure compensation features using a preset weighting adjustment formula based on the adaptive weight matrix to obtain gated local structure compensation features; and fusing the gated local structure compensation features with the aggregated global features to obtain fused features. A terrain segmentation module is used to generate pixel-level classification feature maps corresponding to the fused features for terrain segmentation.
[0010] The present invention also provides an electronic device, comprising: a memory communicatively connected to at least one processor; wherein the processor is configured to execute a computer program stored in the memory; the memory stores a computer program executable by at least one processor, the computer program being executed by at least one processor to enable at least one processor to execute the above-described terrain segmentation method for complex access environments.
[0011] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the terrain segmentation method for complex traffic environments described above.
[0012] This invention utilizes a pre-trained visual base model to extract multi-layer features from environmental topographic maps, providing stable and highly generalizable global semantic features for subsequent terrain segmentation. Selecting target semantic features from the global semantic features for feature aggregation fully leverages the complementary information contained in features at different levels of the visual base model, resulting in aggregated global features that possess both semantic discriminative and spatial structure representation capabilities. Extracting local structure compensation features from the environmental topographic map level by level effectively supplements the local spatial information in the visual base model features. Adaptive weighted residual fusion of the aggregated global features and local structure compensation features enables adaptive collaborative representation of global semantic information and local structural information. While preserving the global semantic expressive power of the visual base model, it effectively introduces local spatial structure information, thereby enhancing the expressive power and scene adaptability of terrain features in complex domain offset environments, ultimately improving the accuracy of terrain segmentation. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating a terrain segmentation method for complex traffic environments provided in an embodiment of the present invention. Figure 2 This is a model architecture diagram for terrain segmentation provided in an embodiment of the present invention; Figure 3 This is a comparison chart of terrain segmentation visualization results provided in an embodiment of the present invention; Figure 4 This is a comparison chart of terrain segmentation performance provided in an embodiment of the present invention; Figure 5 This is a graph showing the comparison results of model timeliness provided in an embodiment of the present invention; Figure 6 The above is a diagram showing the effectiveness ablation experiment results of each functional module provided in an embodiment of the present invention. Figure 7 This is a diagram showing the confusion matrix result provided in an embodiment of the present invention; Figure 8 This is a visualization result of a feature map provided in an embodiment of the present invention; Figure 9 This is a graph showing the test results of generalization ability in a cross-dataset scenario provided by an embodiment of the present invention; Figure 10 A functional block diagram of a terrain segmentation system for complex traffic environments provided in an embodiment of the present invention; Figure 11 This is a schematic diagram of the structure of an electronic device that implements a terrain segmentation method for complex traffic environments, according to an embodiment of the present invention.
[0014] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0015] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0016] This application provides a terrain segmentation method for complex traffic environments. The execution entity of the terrain segmentation method for complex traffic environments includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the terrain segmentation method for complex traffic environments can be executed by software or hardware installed on a terminal device or a server device; the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cluster of cloud servers. The server can be a standalone server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0017] Reference Figure 1 The diagram shown is a flowchart illustrating a terrain segmentation method for complex traffic environments according to an embodiment of the present invention. In this embodiment, the terrain segmentation method for complex traffic environments includes: S1. Obtain environmental topographic maps, and use the visual base model obtained by secondary training on the basis of pre-training to perform cross-level semantic representation of environmental topographic maps to obtain global semantic features.
[0018] In this embodiment of the invention, the environmental topographic map is an environmental image that requires terrain segmentation. For example, when the environmental topographic map is an off-road topographic map, it is a large-scale special topographic map specially made for off-road travel in the wild without roads (hiking and orienteering, mountain biking, wilderness search and rescue, wilderness map reading training). It uses standardized colors to distinguish obstacles such as forests, open spaces, rocks, and water bodies, and finely depicts small undulating landforms. It is specially designed for offline terrain navigation for hiking, orienteering, mountain crossing, and wilderness search and rescue.
[0019] Furthermore, the pre-trained DINOv3 (Distillation with No Labels version 3) visual base model can be retrained using outdoor environmental image datasets such as RELLIS-3D and RUGD to enhance the visual base model's ability to represent the terrain features of the outdoor environment. The DINOv3 visual base model after retraining can then be used as a global semantic encoding network to perform cross-network-level semantic feature representation of the environmental terrain map, thereby obtaining global semantic features.
[0020] In detail, the visual base model obtained by secondary training on the basis of pre-training is used to perform cross-level semantic representation of the environmental topographic map to obtain global semantic features, including: performing image block encoding on the environmental topographic map to obtain an encoding sequence; performing multi-layer attention encoding on the encoding sequence to obtain semantic features of each layer; and collecting semantic features to obtain global semantic features corresponding to the environmental topographic map.
[0021] For example, for environmental topographic maps , ,in, Represents the set of real numbers. Indicates the elevation of the environmental topographic map. To represent the width of the environmental topographic map, the image is first divided into blocks using a 16×16 convolutional kernel, mapping the image to... Each token is an encoded sequence. Subsequently, the encoded sequence is processed sequentially through 12 layers of Transformer attention encoders, such as... Figure 2 The DINOv3 backbone network is shown in the diagram. Each Transformer encoder layer includes a multi-head self-attention mechanism and a feedforward neural network. The self-attention mechanism establishes global contextual relationships, enabling the modeling and representation of semantic information in complex scenes. Specifically, the multi-head self-attention mechanism stabilizes the training process through a scaled dot product attention mechanism, while the feedforward neural network uses the GELU activation function. The feature dimension is first expanded from 384 to 1536 and then restored to 384, and residual connections are used to complete deep feature transformation, resulting in the semantic features of each attention encoder.
[0022] In another optional embodiment of the present invention, the ViT-S (Vision Transformer, Small) variant of DINOv3 can be used as the backbone structure. During model training, the DINOv3 network parameters are not completely frozen, but are first loaded with the original DINOv3 parameters, and then the parameters are updated simultaneously with off-road terrain data and the rest of the model, for example, by training for 50 epochs (batch). This allows the model to retain the general visual representation capabilities obtained from large-scale self-supervised pre-training while further learning terrain semantic features adapted to the environment.
[0023] Specifically, the visual base model is retrained using a pre-defined dataset of images of complex outdoor environments, including: Determine the backbone network of the visual basic model; By using a dataset of images from complex outdoor environments, end-to-end optimization is performed on the backbone network, the preset local structure compensation module, the preset global semantic aggregation module, the preset semantic structure collaborative fusion module, and the preset segmentation head to perform secondary training on the visual base model.
[0024] In end-to-end optimization, DINOv3 starts with its own parameters, while the local structure compensation module, global semantic aggregation module, and semantic structure collaborative fusion module optimize parameters from scratch, thereby achieving secondary training of the visual base model. For details on the backbone network, local structure compensation module, global semantic aggregation module, semantic structure collaborative fusion module, and segmentation head, please refer to [link to relevant documentation]. Figure 2 As shown.
[0025] In this embodiment of the invention, by performing task adaptive optimization on a pre-trained visual basic model, the invention can make full use of the general visual semantic knowledge learned by DINOv3 on large-scale data, improve the model's feature representation ability under complex environmental changes, lighting changes, weather changes and scene migration conditions, and provide stable global semantic features with strong generalization ability for subsequent terrain segmentation.
[0026] S2. Select two sets of target semantic features from different network layers from the global semantic features and perform feature aggregation to obtain aggregated global features.
[0027] In this embodiment of the invention, the output semantic features of the 9th and 12th layer Transformer encoders in DINOv3 are selectively extracted and fused.
[0028] Due to the semantic features of the 12th layer As the top-level output of DINOv3, the 12th layer features, under the constraint of the global contrastive learning objective, possess the strongest semantic discriminative ability (such as the distinguishability between terrain categories), forming the semantic foundation of the network's predictions. However, in pursuit of global semantic optimization, the 12th layer is prone to oversmoothing in the spatial dimension, leading to blurred terrain boundaries. The 9th layer features... At a critical stage where attention is shifting from local to global, it can retain more spatial structural information while maintaining semantic stability.
[0029] Existing methods often fuse shallow features from layers 3 and 6 to capture details. However, the effective information of these shallow features is implicitly covered by layer 9, and retaining shallow features increases feature dimensionality redundancy and computational overhead. Furthermore, the DINOv3 branch only needs to provide semantically clean and structurally stable feature bases; the task of detail recovery is handled by the subsequent local structure compensation module. Introducing shallow features would create feature space conflicts with subsequent modules, thus reducing the fusion effect. By fusing two layers of features, both global semantic representation and spatial structure expression capabilities can be balanced, improving the model's feature robustness in complex scenes and its cross-scene adaptability.
[0030] Specifically, two sets of target semantic features from different network layers are selected from the global semantic features and aggregated to obtain aggregated global features. This includes: selecting target semantic features from the global semantic features and reshaping the target semantic features into two-dimensional feature maps; performing feature mapping and channel compression on the two-dimensional feature maps to obtain compressed feature maps; and adding the compressed feature maps element by element using a preset feature fusion formula to obtain aggregated global features.
[0031] For details, please refer to Figure 2 The global semantic aggregation module in the middle combines the semantic features of the 9th and 12th layers of the global semantic features. Reconstructed into a two-dimensional feature map Afterwards, among them, Representing feature dimension, , These represent the height and width of the feature map corresponding to the semantic features, respectively, and are input to the global semantic aggregation module. The global semantic aggregation module consists of a linear layer, a normalization layer, and a non-linear activation layer, used to perform feature mapping and channel compression. After processing, the number of feature channels is reduced from 384 to 64, improving feature representation efficiency while reducing computational complexity. Subsequently, element-wise addition is performed to generate the fused aggregated global features. .
[0032] Specifically, the compressed feature maps are added element-by-element using a preset feature fusion formula to obtain aggregated global features. The feature fusion formula is expressed as follows:
[0033] in, This indicates the aggregation of global features. express Activation function Presentation layer normalization operation, This indicates a fully connected mapping operation. , These represent the target semantic features respectively.
[0034] In this embodiment of the invention, feature aggregation can fully utilize the complementary information contained in the features of different levels of the visual basic model to obtain global semantic features that have both semantic discrimination ability and spatial structure expression ability. This provides a stable semantic representation foundation for subsequent local structure compensation and feature synergistic fusion, and enhances the model's generalization ability in complex domain offset environments.
[0035] S3. Using the preset local structure compensation feature module, perform two-stage local feature extraction on the environmental topographic map to obtain local structure compensation features.
[0036] In this embodiment of the invention, to enhance the model's ability to represent local spatial structural information, a local structure compensation module is constructed, such as... Figure 2 As shown, the environmental topographic map is used as the input for this module.
[0037] The local structure compensation module adopts a lightweight convolutional neural network architecture, which obtains local spatial correlation information and fine-grained structural features in the terrain scene through a step-by-step feature extraction method, in order to compensate for the shortcomings of the visual basic model in local spatial modeling.
[0038] In detail, a two-stage local feature extraction process is performed on the environmental topographic map using a pre-built local structure compensation feature module to obtain local structure compensation features. This process includes: performing a first convolution process on the environmental topographic map using a pre-constructed first convolution unit to obtain first convolution features; standardizing and activating the first convolution features to obtain basic local structure features; performing a second convolution process on the basic local structure features using a pre-built second convolution unit to obtain second convolution features; and standardizing and activating the second convolution features to obtain local structure compensation features of the environmental topographic map.
[0039] In embodiments of the present invention, such as Figure 2 As shown in the local structure compensation module, the local structure compensation module consists of two levels of convolutional units. The first convolutional unit uses 3... 3 convolutions with a stride of 2 expand the number of channels from 3 to 32, and the feature map resolution is downsampled to [value missing] through normalization layers and activation functions. To obtain basic local structural features; the second convolutional unit also uses 3 A triple convolution with a stride of 2 further expands the number of feature channels for the basic local structural features to 64, and a normalization layer and activation function are used to downsample the resolution of the basic local structural features to [value missing]. This is used to extract more stable local spatial structure information and terrain geometric features, ultimately outputting local structure compensation features. .
[0040] In detail, by constructing a local structure compensation module, local spatial information in the visual base model features can be effectively supplemented while maintaining low computational overhead. This improves the model's ability to express local features under conditions of complex terrain, fine-grained structural changes, and scene changes, providing a reliable local structure representation for subsequent adaptive weighted residuals.
[0041] S4. Adaptive weighted residual fusion is performed on the aggregated global features and local structural compensation features to obtain the fused features.
[0042] In this embodiment of the invention, feature adaptive weighted residual fusion dynamically adjusts the contribution ratio of global semantic information in aggregated global features and local structural information in local structural compensation features to achieve collaborative representation of the two types of features and obtain fused features.
[0043] Specifically, adaptive weighted residual fusion is performed on the aggregated global features and local structural compensation features to obtain fused features. This includes: aligning the aggregated global features and local structural compensation features using bilinear interpolation to obtain aligned features corresponding to the aggregated global features; concatenating the aligned features and local structural compensation features to obtain concatenated features; generating an adaptive weight matrix based on the concatenated features using a preset weight matrix generation formula; adjusting the local structural compensation features using a preset weighting adjustment formula based on the adaptive weight matrix to obtain gated local structural compensation features; and fusing the gated local structural compensation features with the aggregated global features to obtain fused features.
[0044] In embodiments of the present invention, such as Figure 2 As shown, global features will be aggregated. Local structural compensation features The semantic-structural collaborative fusion module is used for joint modeling. First, bilinear interpolation is used to... Upsampling to local structural compensation features Same spatial resolution This achieves spatial alignment of the two types of features. Subsequently, the two types of features are concatenated along the channel dimension, and an adaptive weight matrix M is generated using a 1×1 convolution and a sigmoid activation function with a predefined weight matrix generation formula.
[0045] in, Represents the Sigmoid activation function, [· · indicates a channel concatenation operation. The adaptive weight matrix M represents the contribution of local structural information at different spatial locations to feature fusion. The local structural features are weighted and adjusted using the weight matrix to obtain the enhanced gated local structural compensation features. , Specifically, the local structural features are weighted and adjusted using a preset weighted adjustment formula to obtain the enhanced gated local structural compensation features. The weighted adjustment formula is expressed as follows:
[0046] in, This represents element-wise multiplication. Finally, an adaptive weighted residual fusion method is used to aggregate global features. Compensation features of gated local structure The fusion process is performed to obtain the final fusion characteristics. :
[0047] In this embodiment of the invention, the adaptive weighted residual fusion process enables adaptive collaborative representation of global semantic information and local structural information. While preserving the global semantic expression capability of the visual base model, it effectively introduces local spatial structural information, thereby improving the expressive capability of terrain features and scene adaptability in complex domain offset environments.
[0048] S5. Generate pixel-level classification feature maps corresponding to the fused features for terrain segmentation.
[0049] In the embodiments of the present invention, see Figure 2 As shown, the fused features are input into the pre-constructed segmentation head for pixel-level classification, and a pixel-level terrain category probability map is output to obtain the final off-road terrain segmentation result.
[0050] Specifically, generating pixel-level classification feature maps corresponding to the fused features for terrain segmentation includes: performing convolution processing on the fused features to obtain convolutional mapping features; mapping the feature channels of the convolutional mapping features to a preset number of terrain categories to generate pixel-level classification feature maps corresponding to the fused features; and upsampling the pixel-level classification feature maps to obtain terrain segmentation probability maps corresponding to the environmental terrain maps.
[0051] In this embodiment of the invention, the fusion feature The input is a preset segmentation head for pixel-level classification. The segmentation head consists of a 3×3 convolutional layer and a 1×1 convolutional layer connected in sequence. The 3×3 convolutional layer is used to perform local feature aggregation and channel information interaction on the fused features to obtain convolutional mapping features; the 1×1 convolutional layer is used to map the feature channels of the convolutional mapping features to a preset number of terrain categories to generate the corresponding pixel-level classification feature map.
[0052] Furthermore, the pixel-level classification feature map is upsampled using bilinear interpolation to restore it to the same spatial resolution H×W as the environmental terrain map, thus obtaining the final off-road terrain segmentation probability map.
[0053] This invention employs a lightweight segmentation prediction structure to complete the mapping process from fused features to terrain category space. While ensuring segmentation accuracy, it effectively reduces the number of model parameters and computational complexity, which is beneficial for real-time deployment and application in mobile robots, unmanned platforms, and edge computing devices.
[0054] Preferably, in Figure 2 The terrain segmentation model architecture shown in the diagram is trained by constructing a composite loss function using both CrossEntropy Loss (CE Loss) and Dice Loss to jointly optimize the network parameters. Its expression is as follows:
[0055] in, This represents the cross-entropy loss function, used to constrain the pixel-level classification error between the predicted result and the true label; This represents the Dice loss function, used to measure the degree of overlap between the predicted region and the ground truth labeled region; the loss weight coefficients... This is used to adjust the contribution ratio of two loss functions during model training. The cross-entropy loss function focuses on improving pixel-level classification accuracy, while the Dice loss function focuses on enhancing region-level structural consistency and mitigating the impact of uneven distribution of samples from different terrain categories on model training. Through the joint constraint of the two loss functions, the off-road terrain segmentation model is optimized for training, improving its ability to recognize different terrain categories in complex scenes.
[0056] Figure 3This paper presents a visual comparison of the present invention with existing mainstream terrain segmentation methods on the RELLIS-3D dataset. As shown in the black dashed box areas, in typical scenarios such as muddy grassland mixed areas, densely vegetated areas, and complex terrain boundaries, the comparative methods are prone to class confusion, missegmentation of regions, and discontinuities in target areas. The present invention, however, effectively maintains the integrity and consistency of terrain regions and demonstrates more accurate recognition in complex areas. In the first muddy grassland scenario, facing the blurred transition zone between passable and impassable areas, comparative models such as SegFormer, LRFormer, and Deeplabv3 all exhibited significant boundary misjudgments and region penetration. The present invention, through adaptive fusion of global semantics and local details, accurately depicted the sharp boundaries at terrain boundaries, effectively avoiding semantic confusion. The second scenario focuses on identifying long-distance passable areas under dense vegetation interference. Comparative methods often misclassify distant passable areas as obstacles or cause path breaks due to loss of details. The present invention, however, demonstrates superior feature preservation capabilities, ensuring the continuity and integrity of long-distance passable areas. The third scenario further validated the invention's boundary control capabilities at the junction of grassland and tall vegetation, effectively suppressing the leakage of obstacle features into passable areas and maintaining high-quality segmentation and closure. Experimental results show that the invention has good terrain differentiation and spatial structure preservation capabilities in complex scenarios.
[0057] Figure 4 This paper presents quantitative performance comparisons between the present invention and existing mainstream methods on the RELLIS-3D dataset. The table details the pixel accuracy (%) and average accuracy of each method across six categories: background, smooth, rough, bumpy, no-entry, and obstacles. Experimental results show that the present invention achieves an overall average accuracy of 74.69%, ranking first among all compared methods and outperforming other existing models. Specifically, the present invention excels in the smooth and obstacle categories, which are crucial for mobile robot navigation, with accuracies of 81.97% and 74.34%, respectively. This demonstrates that the present invention can more accurately identify flat, traversable surfaces and effectively avoid obstacles. The aforementioned quantitative data strongly confirms that the present invention possesses stronger feature representation capabilities and higher segmentation accuracy when handling off-road terrain segmentation tasks.
[0058] Figure 5This paper presents comparative results between the present invention and existing methods in terms of model parameter count, computational cost, and inference speed. Experimental results show that while maintaining state-of-the-art (SOTA) segmentation accuracy (74.69%), the present invention can improve inference speed to 75.19 FPS, significantly surpassing traditional heavy models such as Deeplabv3 and Mask2former, and only slightly lower than the lightweight model Segformer, while achieving a significant improvement in accuracy. Furthermore, compared to Lrformer, which also pursues high accuracy, the present invention halves both the parameter count and computational cost (16.38M / 27.92G), verifying the effectiveness of the proposed lightweight design scheme and demonstrating the significant advantages of this method in meeting the stringent real-time perception requirements of applications such as mobile robots.
[0059] Figure 6 The ablation experiments demonstrate the effectiveness of each functional module in this invention. By progressively introducing the global semantic aggregation module, the local structure compensation module, and the semantic structure collaborative fusion module, the experiments clearly verify the contribution of each component to the model performance. The experimental data shows that the average segmentation accuracy of the basic model (containing only the backbone network) is 72.62%. When the global semantic aggregation module is introduced alone, the accuracy improves to 72.98%; adding only the local structure compensation module and the semantic structure collaborative fusion module further increases the accuracy to 73.72%. Finally, when all three modules are integrated, this invention achieves the highest average segmentation accuracy of 74.69%. Meanwhile, the number of model parameters (16.38M) and the amount of floating-point operations (27.92G) only show a slight increase. This fully demonstrates that the proposed functional modules not only effectively improve segmentation accuracy but also possess extremely high computational efficiency, avoiding the common drawback of traditional methods that "trade significant increases in computational cost for improved accuracy," thus verifying the rationality and effectiveness of the proposed technical solution.
[0060] Figure 7 The normalized confusion matrix visually demonstrates the performance comparison between this invention and other methods on the RELLIS-3D dataset. As shown in the figure, the confusion matrix of this invention generally has higher diagonal values and extremely light colors in the off-diagonal areas, indicating that the model has extremely high accuracy in distinguishing various terrain types such as smooth, rough, bumpy, and obstacle-prone terrains, with very few misclassifications and clear boundaries between categories. This result strongly confirms that this invention can effectively overcome the classification difficulties caused by the ambiguity of terrain features in off-road environments, possesses superior category discrimination ability and lower misclassification risk, and can provide more reliable terrain semantic cognition.
[0061] Figure 8The results demonstrate the visualization of features at different stages of this invention. The results show that the features at layers 9 and 12 can provide semantic information at different levels; after global semantic aggregation, the feature maps can more fully represent the scene context information; after local structure compensation, the feature maps show a more significant response to local regions; finally, the fused features obtained through the semantic-structure collaborative fusion module simultaneously take into account both global semantic information and local spatial structure information, providing a more effective feature representation for subsequent segmentation prediction, thereby improving the overall segmentation performance of the model.
[0062] Figure 9 This paper presents the generalization ability test results of the present invention in cross-dataset scenarios. In the experiments, each model was trained on the RELLIS-3D dataset and evaluated directly on the RUGD dataset test set to verify the model's adaptability under conditions of scene differences and data distribution variations. The results in the table show that due to differences between the RELLIS-3D and RUGD datasets in terms of terrain scene distribution, acquisition equipment, and environmental conditions, each model exhibited varying degrees of performance degradation in cross-dataset tests, reflecting the domain offset problem commonly found in off-road terrain segmentation tasks. However, compared to other comparative methods, the present invention maintains higher segmentation performance in cross-dataset tests with a relatively smaller performance degradation, demonstrating better feature transfer ability and environmental adaptability. These results indicate that the off-road terrain segmentation method proposed in this invention can fully utilize the general semantic representation obtained from the visual base model and combine it with a local structural information compensation mechanism to effectively improve the model's robustness and cross-scene generalization ability in complex domain offset environments.
[0063] like Figure 10 The diagram shown is a functional block diagram of a terrain segmentation system for complex traffic environments provided in an embodiment of the present invention.
[0064] The terrain segmentation system 100 for complex traffic environments of the present invention can be installed in an electronic device. Depending on the functions implemented, the terrain segmentation system 100 for complex traffic environments may include a global semantic feature extraction module 101, a global semantic aggregation module 102, a local structure compensation feature extraction module 103, a semantic structure collaborative fusion module 104, and a terrain segmentation module 105. A module, also called a unit, refers to a series of computer program segments that can be executed by the processor of an electronic device and perform a fixed function, stored in the memory of the electronic device.
[0065] In this embodiment, the functions of each module / unit are as follows: The global semantic feature extraction module 101 is used to acquire environmental topographic maps and use the visual basic model obtained by secondary training on the basis of pre-training to perform cross-level semantic representation of the environmental topographic maps to obtain global semantic features. The global semantic aggregation module 102 is used to select two sets of target semantic features from different network layers in the global semantic features and perform feature aggregation to obtain aggregated global features. The local structure compensation feature extraction module 103 is used to perform two-stage local feature extraction on the environmental topographic map using a preset local structure compensation feature module to obtain local structure compensation features. The semantic structure collaborative fusion module 104 is used to perform adaptive weighted residual fusion of aggregated global features and local structure compensation features to obtain fused features. The adaptive weighted residual fusion of aggregated global features and local structure compensation features to obtain fused features includes: aligning aggregated global features and local structure compensation features using bilinear interpolation to obtain aligned features corresponding to aggregated global features; concatenating aligned features with local structure compensation features to obtain concatenated features; generating an adaptive weight matrix based on the concatenated features using a preset weight matrix generation formula; adjusting local structure compensation features using a preset weight adjustment formula based on the adaptive weight matrix to obtain gated local structure compensation features; and fusing gated local structure compensation features with aggregated global features to obtain fused features. The terrain segmentation module 105 is used to generate pixel-level classification feature maps corresponding to the fused features for terrain segmentation.
[0066] In detail, each module in the terrain segmentation system 100 for complex traffic environments in this embodiment of the invention adopts the same approach as described above. Figures 1 to 9 The method uses the same techniques as the terrain segmentation method for complex traffic environments and can produce the same technical effects, so it will not be elaborated here.
[0067] like Figure 11 The diagram shown is a structural schematic of an electronic device that implements a terrain segmentation method for complex traffic environments, according to an embodiment of the present invention.
[0068] The electronic device 500 may include a processor 501, a memory 502, a communication bus 503, and a communication interface 504. It may also include a computer program stored in the memory and capable of running on the processor, such as a terrain segmentation method program for complex access environments.
[0069] In some embodiments, the processor 501 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips.
[0070] The memory 502 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 502 may be an internal storage unit of an electronic device, such as a portable hard drive of the electronic device.
[0071] The communication bus 503 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 502 and at least one processor 501.
[0072] The communication interface 504 is used for communication between the aforementioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, Bluetooth interface, etc.), typically used to establish communication connections between the electronic device and other electronic devices. The user interface may be a display or an input unit (such as a keyboard). Optionally, the user interface may also be a standard wired interface or a wireless interface.
[0073] Figure 11 The image only shows electronic devices with components; it will be understood by those skilled in the art that... Figure 11 The structure shown does not constitute a limitation on the electronic device 500, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0074] Specifically, the processor's implementation method for the above instructions can be found in the description of the relevant steps in the corresponding embodiments in the accompanying drawings, and will not be repeated here.
[0075] In the several embodiments provided by this invention, it should be understood that the disclosed devices, systems, and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0076] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0077] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0078] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0079] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.
[0080] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0081] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or systems stated in a system claim may also be implemented by a single unit or system through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A terrain segmentation method for complex traffic environments, characterized in that, The method includes: An environmental topographic map is acquired, and a visual base model obtained through secondary training based on pre-training is used to perform cross-level semantic representation on the environmental topographic map to obtain global semantic features. Two sets of target semantic features from different network layers are selected from the global semantic features and aggregated to obtain aggregated global features. The environmental topographic map is subjected to two-stage local feature extraction using a preset local structure compensation feature module to obtain local structure compensation features; An adaptive weighted residual fusion is performed on the aggregated global features and the local structure compensation features to obtain fused features. This process includes: aligning the aggregated global features and the local structure compensation features using bilinear interpolation to obtain aligned features corresponding to the aggregated global features; concatenating the aligned features with the local structure compensation features to obtain concatenated features; generating an adaptive weight matrix based on the concatenated features using a preset weight matrix generation formula; adjusting the local structure compensation features using a preset weighting adjustment formula based on the adaptive weight matrix to obtain gated local structure compensation features; and fusing the gated local structure compensation features with the aggregated global features to obtain fused features. Pixel-level classification feature maps corresponding to the fused features are generated for terrain segmentation.
2. The terrain segmentation method for complex traffic environments as described in claim 1, characterized in that, The method of using a visual base model obtained through secondary training based on pre-training to perform cross-level semantic representation of the environmental topographic map, thereby obtaining global semantic features, includes: The visual basic model is trained a second time using a pre-set dataset of images of complex outdoor environments; The environmental topographic map is image-block encoded using the visual basic model obtained through secondary training to obtain an encoding sequence; The encoded sequence is subjected to multi-layer attention encoding to obtain the semantic features of each layer; By aggregating the semantic features, the global semantic features corresponding to the environmental topographic map are obtained.
3. The terrain segmentation method for complex traffic environments as described in claim 2, characterized in that, The secondary training of the visual base model using a pre-set dataset of complex outdoor environment images includes: Determine the backbone network of the aforementioned visual basic model; The backbone network, the preset local structure compensation module, the preset global semantic aggregation module, the preset semantic structure collaborative fusion module, and the preset segmentation head are optimized end-to-end using the aforementioned complex outdoor environment image dataset to perform secondary training on the visual basic model.
4. The terrain segmentation method for complex traffic environments as described in claim 1, characterized in that, The step of selecting two sets of target semantic features from different network layers from the global semantic features and aggregating them to obtain aggregated global features includes: Two sets of target semantic features from different network layers are selected from the global semantic features, and the target semantic features are reshaped into two-dimensional feature maps respectively. The two-dimensional feature map is subjected to feature mapping and channel compression to obtain a compressed feature map; The compressed feature map is added element by element using a preset feature fusion formula to obtain aggregated global features; The feature fusion formula is expressed as follows: in, This indicates the aggregation of global features. express Activation function Presentation layer normalization operation, This indicates a fully connected mapping operation. , These represent the target semantic features respectively.
5. The terrain segmentation method for complex traffic environments as described in claim 1, characterized in that, The method of using a preset local structure compensation feature module to perform two-stage local feature extraction on the environmental topographic map to obtain local structure compensation features includes: The environmental topographic map is processed by a pre-constructed first convolutional unit to obtain the first convolutional feature. The first convolutional features are standardized and activated to obtain basic local structural features. The basic local structural features are processed by a second convolution using a preset second convolution unit to obtain the second convolution features; The second convolutional feature is standardized and activated to obtain the local structure compensation feature of the environmental topographic map.
6. The terrain segmentation method for complex traffic environments as described in claim 1, characterized in that, The adaptive weight matrix is represented as follows: in, Represents the adaptive weight matrix. Represents the Sigmoid activation function, [· ·] indicates a channel splicing operation. This indicates the aggregation of global features. Indicates local structural compensation characteristics; The weighted adjustment formula is expressed as follows: in, This indicates the local structural compensation characteristics of the gating system. Represents the adaptive weight matrix. This indicates the local structural compensation feature.
7. The terrain segmentation method for complex traffic environments as described in claim 1, characterized in that, The step of generating the pixel-level classification feature map corresponding to the fused features for terrain segmentation includes: The fused features are then subjected to convolution processing to obtain convolutional mapping features; The feature channels of the convolutional mapping feature are mapped to a preset number of terrain categories to generate a pixel-level classification feature map corresponding to the fused feature. The pixel-level classification feature map is upsampled to obtain the terrain segmentation probability map corresponding to the environmental terrain map.
8. A terrain segmentation system for complex traffic environments, characterized in that, The system includes: The global semantic feature extraction module is used to acquire environmental topographic maps and use a visual basic model obtained by secondary training on the basis of pre-training to perform cross-level semantic representation on the environmental topographic maps to obtain global semantic features. The global semantic aggregation module is used to select two sets of target semantic features from different network layers from the global semantic features and aggregate them to obtain aggregated global features. The local structure compensation feature extraction module is used to perform two-stage local feature extraction on the environmental topographic map using a preset local structure compensation feature module to obtain local structure compensation features. A semantic structure collaborative fusion module is used to perform adaptive weighted residual fusion on the aggregated global features and the local structure compensation features to obtain fused features. The adaptive weighted residual fusion of the aggregated global features and the local structure compensation features to obtain fused features includes: aligning the aggregated global features and the local structure compensation features using bilinear interpolation to obtain aligned features corresponding to the aggregated global features; concatenating the aligned features with the local structure compensation features to obtain concatenated features; generating an adaptive weight matrix based on the concatenated features using a preset weight matrix generation formula; adjusting the local structure compensation features using a preset weighting adjustment formula based on the adaptive weight matrix to obtain gated local structure compensation features; and fusing the gated local structure compensation features with the aggregated global features to obtain fused features. The terrain segmentation module is used to generate pixel-level classification feature maps corresponding to the fused features for terrain segmentation.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The processor is used to execute computer programs stored in the memory; The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the terrain segmentation method for complex access environments as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the terrain segmentation method for complex traffic environments as described in any one of claims 1 to 7.
