A road extraction method, system and device fusing multi-scale features and boundary perception loss and a storage medium
Patent Information
- Application Number
- CN202611148574.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-09-29
AI Technical Summary
然而,现有方法大多在空间域中对道路特征进行建模,难以同时兼顾局部细节与全局连续性,对遮挡导致的断裂、不同尺度道路的适应性以及窄小道路的漏检问题仍未得到有效解决
[0048]本发明提供的一种融合多尺度特征与边界感知损失的道路提取方法,在编码器中引入HAS模块,经过卷积得到三个不同分辨率的初始特征,并行输入HAS模块进行特征变换,通过级联式多尺度融合策略,每一层对应一个分辨率尺度,能够同时学习不同尺度的道路特征,有效解决了主干道与小巷尺度差异显著的问题,确保对不同宽度道路的充分感知和提取;对初始特征进行局部特征聚合得到局部增强特征能够精确定位道路边缘和局部结构细节;对局部增强特征沿水平方向和垂直方向进行选择性扫描得到全局增强图,捕获全局上下文依赖关系,有效解决了传统卷积方法难以同时兼顾局部与全局信息的问题。
Smart Images

Figure CN122841966A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of remote sensing image road extraction technology, specifically relating to a road extraction method, system, device, and storage medium that integrates multi-scale features and boundary perception loss. Background Technology
[0002] Roads are a core component of a nation's critical infrastructure, and the precise and accurate extraction of road information is of great strategic significance for smart city construction, autonomous driving systems, land planning, and disaster emergency response. However, road scenes in remote sensing imagery are complex and multifaceted, and achieving high-precision extraction still faces many challenges. For example, roads are often obscured by buildings and vegetation, leading to topological breaks; road edges are blurred and difficult to distinguish from the surrounding environment; there are significant scale differences between main roads and alleyways; and there are generalization problems caused by variations in resolution from multiple image sources. In particular, small, narrow, and obscured fragmented roads in urban areas often constitute an important part of the transportation network, but these roads are easily overlooked or incompletely extracted using traditional methods, seriously affecting the continuity and accuracy of the road network.
[0003] Traditional road extraction methods are limited by complex terrain, shadows, and noise interference, resulting in poor performance in identifying small and broken roads, and are prone to breaks or missed detections. In recent years, the development of convolutional neural networks has provided new ideas for improving the accuracy of road extraction. However, most existing methods model road features in the spatial domain, making it difficult to simultaneously consider local details and global continuity. The problems of breaks caused by occlusion, adaptability to roads of different scales, and missed detections of narrow roads have not yet been effectively solved. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a road extraction method, system, device and storage medium that integrates multi-scale features and boundary-aware loss. By combining a multi-scale feature fusion strategy and a boundary-aware loss function, it can effectively capture detailed structures and achieve refined extraction of urban road networks.
[0005] This invention provides the following technical solution:
[0006] Firstly, a road extraction method that integrates multi-scale features and boundary-aware loss is provided, including: acquiring remote sensing road images to be processed;
[0007] The remote sensing road image to be processed is input into a pre-trained improved TransUNet model to obtain the road extraction result;
[0008] The improved TransUNet model includes an encoder, a skip connection layer, a Transformer encoder layer, and a decoder.
[0009] In the encoder, each coding layer convolves the remote sensing road image to be processed to obtain initial features. The initial features of the current coding layer are concatenated with those of the previous coding layer to obtain concatenated features. The concatenated features are then aggregated locally by the HAS module to obtain local enhanced features. The local enhanced features are then selectively scanned along the horizontal and vertical directions to obtain a global enhanced map. The local enhanced features are then fused with the global enhanced map to obtain the output features of the coding layer. The output features of the last coding layer are then input into the Transformer coding layer.
[0010] In the skip connection layer, the output feature of the last coding layer is used as the output feature of the last skip connection layer, and the output features of the two adjacent coding layers are fused and used as the output features of the remaining skip connection layers. The output features of the skip connection layer are then input into the upsampling layer corresponding to the decoder.
[0011] The output of the Transformer coding layer is input into the first upsampling layer of the decoder, so that the decoder outputs the road extraction result based on the output features of the Transformer coding layer and the skip connection layer.
[0012] As an optional technical solution of the present invention, the encoder includes three coding layers, each of which performs convolution on the remote sensing road image to be processed to obtain initial features at different resolutions;
[0013] Initial features at different resolutions are input into the HAS module in the corresponding coding layer to obtain the output features of each coding layer. The output features of the first coding layer are the first-scale feature map, the output features of the second coding layer are the second-scale feature map, and the output features of the third coding layer are the third-scale feature map.
[0014] As an optional technical solution of the present invention, the HAS module includes a neighborhood attention unit and a two-dimensional selective scanning unit;
[0015] The neighborhood attention unit is used to perform local feature aggregation on the spliced features to obtain locally enhanced features;
[0016] The two-dimensional selective scanning unit is used to selectively scan local enhancement features along the horizontal and vertical directions to obtain a global enhancement map.
[0017] As an optional technical solution of the present invention, the step of performing local feature aggregation on the spliced features to obtain local enhanced features includes:
[0018] Each pixel on the spliced feature is used as a query point, and a query vector, a key vector, and a value vector are generated respectively through linear projection.
[0019] The enhanced features of each pixel are obtained by weighted aggregation of the value vector, as follows:
[0020] ;
[0021] in, Represents the enhancement features of a pixel. Represents the query vector. Represents the key vector. Represents a value vector. Indicates transpose. Represents the normalized exponential function, Indicates the scaling factor;
[0022] The enhanced features of all pixels are weighted and aggregated to obtain local enhanced features.
[0023] As an optional technical solution of the present invention, the step of selectively scanning the local enhancement features along the horizontal and vertical directions to obtain the global enhancement map includes:
[0024] The local enhancement features are selectively scanned along the horizontal direction from left to right and from right to left, and along the vertical direction from top to bottom and from bottom to top, respectively, to obtain scanning sequences in four directions;
[0025] Modeling the scan sequences in four directions separately yields the state sequences in the four directions, which are represented as follows: , , , ,in This represents the state sequence from left to right. This represents a sequence of states from right to left. This represents a top-down sequence of states. This represents a bottom-up sequence of states. Indicates local enhancement features, This indicates scanning from left to right. This indicates scanning from right to left. This indicates scanning from top to bottom. This indicates a bottom-up scan.
[0026] After performing global average pooling on the local enhancement features, the adaptive weights in four directions are obtained by first 1×1 convolution, SiLU activation function, second 1×1 convolution, and Softmax normalization.
[0027] The state sequences in each of the four directions are weighted channel-by-channel with their corresponding adaptive weights to obtain the weighted state sequence for each direction, as follows:
[0028] ;
[0029] in, Indicates the first Adaptive weights in each direction, Indicates the first The state sequence after weighting in each direction;
[0030] The weighted state sequences from the four directions are cross-fused to obtain a global augmented graph.
[0031] As an optional technical solution of the present invention, the step of fusing the output features of two adjacent coding layers as the output features of the remaining skip connection layers includes:
[0032] The first scale feature map and the second scale feature map are fused together and used as the output feature of the first skip connection layer.
[0033] The second-scale feature map and the third-scale feature map are fused together and used as the output features of the second skip connection layer.
[0034] As an optional technical solution of the present invention, the training process of the improved TransUNet model includes:
[0035] The parameters of the improved TransUNet model are updated with the goal of minimizing the joint loss function.
[0036] The joint loss function is expressed as:
[0037] ;
[0038] in, Denotes the joint loss function. This indicates Dice's loss. Indicates active boundary loss. The weights represent the Dice loss. The weights represent the active boundary loss.
[0039] Secondly, a road extraction system that integrates multi-scale features and boundary-aware loss is provided, including: a data acquisition module for acquiring remote sensing road images to be processed;
[0040] The road extraction module is used to input the remote sensing road image to be processed into a pre-trained improved TransUNet model to obtain the road extraction results.
[0041] The improved TransUNet model includes an encoder, a skip connection layer, a Transformer encoder layer, and a decoder.
[0042] In the encoder, each coding layer convolves the remote sensing road image to be processed to obtain initial features. The initial features of the current coding layer are concatenated with those of the previous coding layer to obtain concatenated features. The concatenated features are then aggregated locally by the HAS module to obtain local enhanced features. The local enhanced features are then selectively scanned along the horizontal and vertical directions to obtain a global enhanced map. The local enhanced features are then fused with the global enhanced map to obtain the output features of the coding layer. The output features of the last coding layer are then input into the Transformer coding layer.
[0043] In the skip connection layer, the output feature of the last coding layer is used as the output feature of the last skip connection layer, and the output features of the two adjacent coding layers are fused and used as the output features of the remaining skip connection layers. The output features of the skip connection layer are then input into the upsampling layer corresponding to the decoder.
[0044] The output of the Transformer coding layer is input into the first upsampling layer of the decoder, so that the decoder outputs the road extraction result based on the output features of the Transformer coding layer and the skip connection layer.
[0045] Thirdly, a road extraction apparatus that integrates multi-scale features and boundary-aware loss is provided, comprising a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the method described in the first aspect.
[0046] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the steps of the method described in the first aspect.
[0047] Compared with the prior art, the beneficial effects of the present invention are:
[0048] This invention provides a road extraction method that integrates multi-scale features and boundary-aware loss. A HAS module is introduced into the encoder, and three initial features at different resolutions are obtained through convolution. These initial features are then input into the HAS module in parallel for feature transformation. Through a cascaded multi-scale fusion strategy, each layer corresponds to a resolution scale, enabling the simultaneous learning of road features at different scales. This effectively solves the problem of significant scale differences between main roads and alleyways, ensuring sufficient perception and extraction of roads of different widths. Local feature aggregation of the initial features yields locally enhanced features that accurately locate road edges and local structural details. Selective scanning of the locally enhanced features along the horizontal and vertical directions yields a global enhanced map, capturing global contextual dependencies. This effectively solves the problem that traditional convolutional methods struggle to simultaneously consider both local and global information. Attached Figure Description
[0049] Figure 1This is a flowchart illustrating a road extraction method that integrates multi-scale features and boundary-aware loss in an embodiment of the present invention.
[0050] Figure 2 This is a schematic diagram of the structure of the improved TransUNet model in an embodiment of the present invention;
[0051] Figure 3 This is a schematic diagram of the HAS module in an embodiment of the present invention;
[0052] Figure 4 This is a schematic diagram of the query-key-value structure of neighborhood attention on a single pixel in an embodiment of the present invention;
[0053] Figure 5 This is a schematic diagram of the two-dimensional selective scanning structure in an embodiment of the present invention. Detailed Implementation
[0054] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0055] Example 1
[0056] This embodiment provides a road extraction method that integrates multi-scale features and boundary-aware loss. For example... Figure 1 As shown, it includes the following steps:
[0057] Step 1: Acquire the remote sensing road image to be processed.
[0058] Step 2: Input the remote sensing road image to be processed into the pre-trained improved TransUNet model to obtain the road extraction results.
[0059] like Figure 2 As shown, the improved TransUNet model includes an encoder, a skip connection layer, a Transformer encoding layer, a decoder, and a segmentation head.
[0060] In the encoder, each coding layer performs convolution on the remote sensing road image to be processed to obtain initial features. The initial features of the current coding layer are concatenated with those of the previous coding layer to obtain concatenated features. After local feature aggregation through the HAS module to obtain local enhanced features, the local enhanced features are selectively scanned along the horizontal and vertical directions to obtain a global enhanced map. The local enhanced features and the global enhanced map are fused to obtain the output features of the coding layer. The output features of the last coding layer are then input into the Transformer coding layer.
[0061] In this embodiment, the encoder includes three coding layers. Each coding layer convolves the remote sensing road image to be processed to obtain initial features at different resolutions. The initial features at different resolutions are then input into the HAS module in the corresponding coding layer to obtain the output features of each coding layer. The output features of the first coding layer are the first-scale feature maps, the output features of the second coding layer are the second-scale feature maps, and the output features of the third coding layer are the third-scale feature maps.
[0062] like Figure 3 As shown, the HAS module includes a neighborhood attention unit Natten and a two-dimensional selective scanning unit SS2D.
[0063] The neighborhood attention unit is used to perform local feature aggregation on the spliced features to obtain locally enhanced features. Specifically:
[0064] like Figure 4 As shown, each pixel on the spliced feature is used as a query point, and a query vector, a key vector, and a value vector are generated by linear projection.
[0065] The enhanced features of each pixel are obtained by weighted aggregation of the value vector, as follows:
[0066] ;
[0067] in, Represents the enhancement features of a pixel. Represents the query vector. Represents the key vector. Represents a value vector. Indicates transpose. Represents the normalized exponential function, Indicates the scaling factor;
[0068] like Figure 5 As shown, the two-dimensional selective scanning unit is used to selectively scan local enhancement features along the horizontal and vertical directions to obtain a global enhancement map. Specifically:
[0069] The local enhancement features were selectively scanned along the horizontal direction from left to right and from right to left, and along the vertical direction from top to bottom and from bottom to top, to obtain scanning sequences in four directions.
[0070] Modeling the scan sequences in four directions separately yields the state sequences in the four directions, which are represented as follows: , , , ,in This represents the state sequence from left to right. This represents a sequence of states from right to left. This represents a top-down sequence of states. This represents a bottom-up sequence of states. Indicates local enhancement features, This indicates scanning from left to right. This indicates scanning from right to left. This indicates scanning from top to bottom. This indicates scanning from bottom to top.
[0071] After performing global average pooling on the local enhanced features, the adaptive weights in four directions are obtained through a first 1×1 convolution, SiLU activation function, second 1×1 convolution, and Softmax normalization.
[0072] The state sequences in each of the four directions are weighted channel-by-channel with their corresponding adaptive weights to obtain the weighted state sequence for each direction, as follows:
[0073] ;
[0074] in, Indicates the first Adaptive weights in each direction, Indicates the first The state sequence after weighting in each direction.
[0075] The weighted state sequences from the four directions are cross-fused to obtain a global augmented graph.
[0076] The two-dimensional selective scanning unit is used to selectively scan local enhancement features along the horizontal and vertical directions to obtain a global enhancement map.
[0077] In the skip connection layer, the output feature of the last coding layer is used as the output feature of the last skip connection layer. The output features of two adjacent coding layers are fused and used as the output features of the remaining skip connection layers. The first-scale feature map and the second-scale feature map are fused and used as the output feature of the first skip connection layer. The second-scale feature map and the third-scale feature map are fused and used as the output feature of the second skip connection layer. The output features of the skip connection layers are then input into the corresponding upsampling layer of the decoder.
[0078] The output of the Transformer encoder layer is input into the first upsampling layer of the decoder, enabling the decoder to output the path extraction result based on the output features of the Transformer encoder layer and the skip connection layer. The decoder consists of multiple cascaded decoding blocks, each containing an upsampling layer and two convolutional blocks. The token sequence output by the Transformer encoder is reshaped into spatial features and transformed to a preset number of channels through convolution. Then, it passes through multiple decoding blocks sequentially: each decoding block upsamples the feature map to twice its size, concatenates it along the channel dimension with the skip connection features of the HAS encoder at the corresponding scale, and outputs a dimensionality-reduced feature map after processing by two convolutional blocks. Through progressive upsampling and skip connection fusion, high-resolution detail information from the shallow encoder is gradually transferred to the deeper layers, effectively combining with semantic information to ensure that the final output feature map contains both rich semantic information and accurate spatial details.
[0079] Improvements to the training process of the TransUNet model, including:
[0080] The parameters of the improved TransUNet model are updated with the goal of minimizing the joint loss function.
[0081] The joint loss function is expressed as:
[0082] ;
[0083] in, Denotes the joint loss function. This indicates Dice's loss. Indicates active boundary loss. The weights represent the Dice loss. The weights represent the active boundary loss.
[0084] Example 2
[0085] This embodiment provides a road extraction system that integrates multi-scale features and boundary-aware loss, including:
[0086] The data acquisition module is used to acquire remote sensing road images to be processed;
[0087] The road extraction module is used to input the remote sensing road image to be processed into a pre-trained improved TransUNet model to obtain the road extraction results.
[0088] The improved TransUNet model includes an encoder, a skip connection layer, a Transformer encoder layer, and a decoder.
[0089] In the encoder, each coding layer convolves the remote sensing road image to be processed to obtain initial features. The initial features of the current coding layer are concatenated with those of the previous coding layer to obtain concatenated features. The concatenated features are then aggregated locally by the HAS module to obtain local enhanced features. The local enhanced features are then selectively scanned along the horizontal and vertical directions to obtain a global enhanced map. The local enhanced features are then fused with the global enhanced map to obtain the output features of the coding layer. The output features of the last coding layer are then input into the Transformer coding layer.
[0090] In the skip connection layer, the output feature of the last coding layer is used as the output feature of the last skip connection layer, and the output features of the two adjacent coding layers are fused and used as the output features of the remaining skip connection layers. The output features of the skip connection layer are then input into the upsampling layer corresponding to the decoder.
[0091] The output of the Transformer coding layer is input into the first upsampling layer of the decoder, so that the decoder outputs the road extraction result based on the output features of the Transformer coding layer and the skip connection layer.
[0092] Example 3
[0093] This embodiment takes processing a standard high-resolution remote sensing road image as an example to illustrate in detail the specific data flow paths and dimensional changes between different network layers during the actual operation of the method in Embodiment 1. Specifically:
[0094] The input remote sensing image to the network is an RGB three-channel image with a normalized resolution of 512×512 pixels. First, the data enters the multi-scale hybrid encoder (HAS) stage. This stage downsamples the image to different resolutions through convolutional downsampling operations, obtaining feature maps at three scales. These three feature maps correspond to high-resolution, medium-resolution, and low-resolution scales, respectively. Each feature map is input into a corresponding layer of the HAS encoder for feature transformation. In each layer, the feature map first undergoes local feature aggregation through a neighborhood attention module, which calculates attention weights within a sliding window centered on each pixel and performs weighted aggregation. Then, it passes through a two-dimensional selective scanning module, performing four selective scans: horizontally from left to right and right to left, and vertically from top to bottom and bottom to top. The outputs from these four directions are weighted and fused to obtain the enhanced feature map. The enhanced feature map from the low-resolution layer is passed to the high-resolution layer through cascaded fusion, achieving hierarchical interaction of multi-scale features. After processing by the HAS encoder, the three-scale enhanced feature maps are output.
[0095] The low-resolution deep feature map output by the HAS encoder enters the Transformer encoder stage. This feature map is first projected to a preset dimension via convolution, flattened into a token sequence, and then fed into the Transformer encoder after learningable positional encoding is added. The Transformer encoder consists of multiple Transformer blocks, each containing a multi-head self-attention mechanism and a feedforward network, with layer normalization used for normalization before residual connections. After processing by multiple Transformer blocks, the output is an encoded feature map with global contextual information.
[0096] The encoded feature map enters the decoder stage. The decoder employs a "stepwise upsampling and skip connection fusion" strategy: first, the token sequence output by the Transformer is reshaped into spatial features, which are then passed sequentially through multiple decoding blocks after convolutional transformation. Each decoding block upsamples the feature map to twice its size and concatenates it with the skip connection features of the HAS encoder at the corresponding scale, then outputs it after processing by two convolutional blocks. Through stepwise upsampling and fusion, the spatial resolution is gradually restored. The final decoded feature map is input to the segmentation head, and after convolution and upsampling, a 512×512 road probability map is output.
[0097] Example 4
[0098] This embodiment provides a road extraction apparatus that fuses multi-scale features and boundary-aware loss, including a processor and a storage medium. The storage medium is used to store instructions. The processor is used to operate according to the instructions to execute the steps of the road extraction method that fuses multi-scale features and boundary-aware loss as described in Embodiment 1.
[0099] Example 5
[0100] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the road extraction method that fuses multi-scale features and boundary-aware loss as described in Embodiment 1.
[0101] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0102] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0103] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0104] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0105] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A road extraction method that integrates multi-scale features and boundary-aware loss, characterized in that, include: Acquire the remote sensing road image to be processed; The remote sensing road image to be processed is input into a pre-trained improved TransUNet model to obtain the road extraction result; The improved TransUNet model includes an encoder, a skip connection layer, a Transformer encoder layer, and a decoder. In the encoder, each coding layer convolves the remote sensing road image to be processed to obtain initial features. The initial features of the current coding layer are concatenated with those of the previous coding layer to obtain concatenated features. The concatenated features are then aggregated locally by the HAS module to obtain local enhanced features. The local enhanced features are then selectively scanned along the horizontal and vertical directions to obtain a global enhanced map. The local enhanced features are then fused with the global enhanced map to obtain the output features of the coding layer. The output features of the last coding layer are then input into the Transformer coding layer. In the skip connection layer, the output feature of the last coding layer is used as the output feature of the last skip connection layer, and the output features of the two adjacent coding layers are fused and used as the output features of the remaining skip connection layers. The output features of the skip connection layer are then input into the upsampling layer corresponding to the decoder. The output of the Transformer coding layer is input into the first upsampling layer of the decoder, so that the decoder outputs the road extraction result based on the output features of the Transformer coding layer and the skip connection layer.
2. The road extraction method fusing multi-scale features and boundary-aware loss according to claim 1, characterized in that, The encoder includes three coding layers. Each coding layer convolves the remote sensing road image to be processed to obtain initial features at different resolutions. Initial features at different resolutions are input into the HAS module in the corresponding coding layer to obtain the output features of each coding layer. The output features of the first coding layer are the first-scale feature map, the output features of the second coding layer are the second-scale feature map, and the output features of the third coding layer are the third-scale feature map.
3. The road extraction method fusing multi-scale features and boundary-aware loss according to claim 1, characterized in that, The HAS module includes a neighborhood attention unit and a two-dimensional selective scanning unit; The neighborhood attention unit is used to perform local feature aggregation on the spliced features to obtain locally enhanced features; The two-dimensional selective scanning unit is used to selectively scan local enhancement features along the horizontal and vertical directions to obtain a global enhancement map.
4. The road extraction method fusing multi-scale features and boundary-aware loss according to claim 3, characterized in that, The process of performing local feature aggregation on the spliced features to obtain locally enhanced features includes: Each pixel on the spliced feature is used as a query point, and a query vector, a key vector, and a value vector are generated respectively through linear projection. The enhanced features of each pixel are obtained by weighted aggregation of the value vector, as follows: ; in, Represents the enhancement features of a pixel. Represents the query vector. Represents the key vector. Represents a value vector. Indicates transpose. Represents the normalized exponential function, Indicates the scaling factor; The enhanced features of all pixels are weighted and aggregated to obtain local enhanced features.
5. The road extraction method fusing multi-scale features and boundary-aware loss according to claim 3, characterized in that, The selective scanning of local enhancement features along the horizontal and vertical directions to obtain a global enhancement map includes: The local enhancement features are selectively scanned along the horizontal direction from left to right and from right to left, and along the vertical direction from top to bottom and from bottom to top, respectively, to obtain scanning sequences in four directions; Modeling the scan sequences in four directions separately yields the state sequences in the four directions, which are represented as follows: , , , ,in This represents the state sequence from left to right. This represents a sequence of states from right to left. This represents a top-to-bottom sequence of states. This represents a bottom-up sequence of states. Indicates local enhancement features, This indicates scanning from left to right. This indicates scanning from right to left. This indicates scanning from top to bottom. This indicates a bottom-up scan. After performing global average pooling on the local enhanced features, the adaptive weights in four directions are obtained by first 1×1 convolution, SiLU activation function, second 1×1 convolution, and Softmax normalization. The state sequences in each of the four directions are weighted channel-by-channel with their corresponding adaptive weights to obtain the weighted state sequence for each direction, as follows: ; in, Indicates the first Adaptive weights in each direction, Indicates the first The state sequence after weighting in each direction; The weighted state sequences from the four directions are cross-fused to obtain a global augmented graph.
6. The road extraction method fusing multi-scale features and boundary-aware loss according to claim 2, characterized in that, The step of fusing the output features of two adjacent coding layers as the output features of the remaining skip connection layers includes: The first scale feature map and the second scale feature map are fused together and used as the output feature of the first skip connection layer. The second-scale feature map and the third-scale feature map are fused together and used as the output features of the second skip connection layer.
7. The road extraction method fusing multi-scale features and boundary-aware loss according to claim 1, characterized in that, The training process of the improved TransUNet model includes: The parameters of the improved TransUNet model are updated with the goal of minimizing the joint loss function. The joint loss function is expressed as: ; in, Denotes the joint loss function. This indicates Dice's loss. Indicates active boundary loss. The weights represent the Dice loss. The weights represent the active boundary loss.
8. A road extraction system that integrates multi-scale features and boundary-aware loss, characterized in that, include: The data acquisition module is used to acquire remote sensing road images to be processed; The road extraction module is used to input the remote sensing road image to be processed into a pre-trained improved TransUNet model to obtain the road extraction results. The improved TransUNet model includes an encoder, a skip connection layer, a Transformer encoder layer, and a decoder. In the encoder, each coding layer convolves the remote sensing road image to be processed to obtain initial features. The initial features of the current coding layer are concatenated with those of the previous coding layer to obtain concatenated features. The concatenated features are then aggregated locally by the HAS module to obtain local enhanced features. The local enhanced features are then selectively scanned along the horizontal and vertical directions to obtain a global enhanced map. The local enhanced features are then fused with the global enhanced map to obtain the output features of the coding layer. The output features of the last coding layer are then input into the Transformer coding layer. In the skip connection layer, the output feature of the last coding layer is used as the output feature of the last skip connection layer, and the output features of the two adjacent coding layers are fused and used as the output features of the remaining skip connection layers. The output features of the skip connection layer are then input into the upsampling layer corresponding to the decoder. The output of the Transformer coding layer is input into the first upsampling layer of the decoder, so that the decoder outputs the road extraction result based on the output features of the Transformer coding layer and the skip connection layer.
9. A road extraction device that integrates multi-scale features and boundary-aware loss, characterized in that, Including processor and storage media; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the road extraction method according to any one of claims 1 to 7, which integrates multi-scale features and boundary-aware loss.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the road extraction method that integrates multi-scale features and boundary-aware loss as described in any one of claims 1 to 7.
