Lightweight semantic object segmentation method based on local window cross attention

CN116645508BActive Publication Date: 2026-08-07CHONGQING JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING JIAOTONG UNIV
Filing Date
2023-05-23
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

这类方法不能跨视图处理特征,分割结果容易受到环境影响而出现歧义,严重影响语义分割准确度

Benefits of technology

[0042]本发明的有益效果:本发明通过构建BEV查询和图像特征之间的局部窗口交叉注意力,完成对跨相机透视图之间的特征查询,减少了查询计算量,提高了查询准确度和语义分割效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116645508B_ABST
    Figure CN116645508B_ABST
Patent Text Reader

Abstract

The application provides a lightweight semantic target segmentation method based on local window cross attention, comprising the following steps: S1. Constructing a lightweight semantic segmentation network, wherein the lightweight semantic segmentation network comprises an improved EdgeNeXt network, a cross-view conversion encoder and a BEV feature decoder; S2. Inputting a sample image into the lightweight semantic segmentation network for training; S3. Determining whether the lightweight semantic segmentation network is trained, if yes, entering step S4, if not, returning to step S2 until the training completion target is reached; and S4. Real-time collection of an environment image, inputting the environment image into the trained lightweight semantic segmentation network for semantic segmentation, and outputting a semantic segmentation result. Through the above method, cross-camera perspective feature query can be realized, the BEV query can focus on the correct local area, the query calculation amount is reduced, and the query accuracy and semantic segmentation efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of semantic segmentation, and more particularly to a lightweight semantic target segmentation method based on local window cross attention. Background Technology

[0002] Autonomous vehicles rely heavily on their understanding of the environment, such as traffic sign detection and obstacle detection. In surround-view multi-camera semantic segmentation tasks, previous research primarily focused on segmenting 2D objects using a single camera, then projecting the segmentation results onto a unified vehicle coordinate system to obtain 3D output through cross-camera post-processing. These methods cannot process features across views, and the segmentation results are easily affected by environmental factors, leading to ambiguity and severely impacting semantic segmentation accuracy. In autonomous vehicle environmental perception tasks, the use of surround-view cameras for semantic segmentation of lane lines, vehicles, and other targets in a unified bird's-eye view (BEV) coordinate system has attracted widespread attention. However, increasing the number of cameras leads to a linear increase in inference latency, making real-time semantic segmentation difficult.

[0003] To solve the above-mentioned technical problems, it is urgent to propose a new technical approach. Summary of the Invention

[0004] This invention provides a lightweight semantic target segmentation method based on local window cross-attention, comprising the following steps:

[0005] S1. Construct a lightweight semantic segmentation network, which includes an improved EdgeNeXt network, a cross-view transformation encoder, and a BEV feature decoder;

[0006] The improved EdgeNeXt network serves as the backbone network. The feature pyramid of the improved EdgeNeXt network is constructed by adding residual blocks. The improved EdgeNeXt network is used to capture global and local information of the image.

[0007] The cross-view transformation encoder includes a BEV local window query module and a cross attention module. The cross-view transformation encoder is used to query image features across camera perspectives.

[0008] The BEV feature decoder consists of upsampled residual blocks and a segmentation head, used to complete semantic segmentation;

[0009] S2. Input the sample images into a lightweight semantic segmentation network for training;

[0010] S3. Determine whether the lightweight semantic segmentation network has been trained. If yes, proceed to step S4; otherwise, return to step S2 until the training is completed.

[0011] S4. Real-time acquisition of environmental images, input of environmental images into a trained lightweight semantic segmentation network for semantic segmentation, and output of semantic segmentation results.

[0012] Furthermore, in step S1, the EdgeNeXt network is constructed using the following method:

[0013] The EdgeNeXt network includes Stage1, Stage2, Stage3, Stage4 modules and a feature pyramid module;

[0014] The output of Stage 1 is connected to the input of Stage 2, the output of Stage 2 is connected to the input of Stage 3, the output of Stage 3 is connected to the input of Stage 4, and the outputs of Stage 2, Stage 3, and Stage 4 are connected to the input of the feature pyramid module.

[0015] S111. Construct the Stage1 module, which contains a 4×4 convolutional layer and a 3×3 convolutional encoder. The output of the convolutional layer is connected to the input of the convolutional encoder.

[0016] S112. Construct the Stage2 module. The Stage2 module includes a downsampling module, a 5×5 convolutional encoder, a position encoder, and a depth transpose attention encoder. The output of the downsampling module is connected to the input of the convolutional encoder. The outputs of the convolutional encoder and the position encoder are fused to obtain a fused feature map. The fused feature map is then input into the depth transpose attention encoder.

[0017] S113. Construct the Stage3 module, which includes a downsampling module, a 7×7 convolutional encoder, and a depth transpose attention encoder. The output of the downsampling module is connected to the input of the convolutional encoder, and the output of the convolutional encoder is connected to the input of the depth transpose attention encoder.

[0018] S114. Construct the Stage4 module, which includes a downsampling module, a 7×7 convolutional encoder, and a depth transpose attention encoder;

[0019] S115. Construct a feature pyramid module, which includes an upsampling module, a downsampling module, and a residual block. Specifically, the output of Stage 2 is downsampled, the output of Stage 4 is upsampled, and the downsampled output of Stage 2, the upsampled output of Stage 4, and the output of Stage 3 are concatenated. The concatenation result is then input into the residual block.

[0020] Furthermore, in step S1, the cross-view transformation encoder determines the size of the BEV grid based on the sensor's sensing distance and the camera's resolution, divides the BEV grid into 4 windows, and performs cross-attention calculation on the BEV query and the perspective view corresponding to the BEV query within the window, outputting a BEV feature map Z that fuses the perspective view features.

[0021] Furthermore, the cross-attention between the perspective feature map and the BEV feature map is accomplished using the following method:

[0022] First, let the perspective feature T∈R N×H×W×C Transform into BEV features B∈R X×Y×C Where, represents the number of sensors, H represents the pixel height, W represents the pixel width, C represents the number of channels, X represents the grid length, and Y represents the grid width;

[0023] Secondly, the BEV coordinates B J Convert to perspective coordinates T J The conversion process is as follows:

[0024]

[0025]

[0026] Where u and v represent the BEV coordinates of the image, d represents the depth, and B... J = (u,v,d), where u′ and v′ represent B J The BEV coordinates obtained after inputting the coordinates into the resize function, where I represents the camera intrinsic matrix and E represents the camera extrinsic matrix. -1 The inverse matrix representing the camera extrinsic parameters;

[0027] Then, cross-attention is performed by calculating the cosine similarity between the BEV coordinates of the perspective image backprojection and the BEV grid coordinates. The specific process is as follows:

[0028] A backprojection index of the perspective feature map is constructed based on the size of the perspective feature map, and K and V are obtained through a linear projection layer. The formulas for K and V are as follows:

[0029] K = M(EI) -1 T J′ )

[0030] V = M(T) J )

[0031] Where K represents the back projection index matrix, K∈R N×HW×d V represents the BEV image feature, V∈R NHW×d N represents the number of sensors, T J′This represents the perspective coordinate transpose, where H represents pixel height, W represents pixel width, d represents depth, E represents camera extrinsic matrix, and I represents the perspective coordinate transpose. -1 The matrix represents the inverse of the camera intrinsic parameter matrix, M represents the linear projection layer, and T represents the inverse of the intrinsic parameter matrix. J Represents perspective coordinates;

[0032] Calculate cosine similarity:

[0033]

[0034] Where sim represents cosine similarity. B represents the perspective coordinates. J Denotes BEV coordinates, E represents the camera extrinsic parameter matrix, and K represents the BEV coordinates. -1 The matrix represents the inverse of the back projection index matrix, and n represents the number of views;

[0035] Finally, the feature map Z is output. The feature map Z is obtained by fusing the features of the BEV query and the corresponding perspective of the BEV query:

[0036] Z = CrossAttention(Q,K,V)

[0037] Where Z represents the feature map, Q represents the query window, K represents the back projection index matrix, and V represents the BEV image features.

[0038] Furthermore, in step S2, the initial learning rate of the lightweight semantic segmentation network is set to 1e-4, the weight decay is 0.01, the batch size for training in a single pass is set to 8, the cross-entropy loss function is used, and the Adam optimizer is used. The formula for the cross-entropy loss function is as follows:

[0039]

[0040] Where A represents the total number of samples, b represents the number of target detection categories, and P ic y represents the predicted probability that sample i is c. ic This indicates whether sample i belongs to category c. If yes, c is 1; otherwise, c is 0.

[0041] Furthermore, in step S3, the lightweight semantic segmentation network training is completed when the sample dataset has completed 20 rounds of training.

[0042] The beneficial effects of this invention are as follows: By constructing a local window cross-attention between BEV queries and image features, this invention completes feature queries across camera perspectives, reducing query computation and improving query accuracy and semantic segmentation efficiency. Attached Figure Description

[0043] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0044] Figure 1 This is a flowchart of the present invention;

[0045] Figure 2 This is the overall network structure of the present invention;

[0046] Figure 3 This is the backbone network structure of the present invention;

[0047] Figure 4 This is a diagram illustrating the local window cross-attention process of the present invention. Detailed Implementation

[0048] The present invention will be further described below with reference to the accompanying drawings:

[0049] This invention provides a lightweight semantic target segmentation method based on local window cross-attention, comprising the following steps:

[0050] S1. Construct a lightweight semantic segmentation network, which includes an improved EdgeNeXt network, a cross-view transformation encoder, and a BEV feature decoder;

[0051] The improved EdgeNeXt network serves as the backbone network. The feature pyramid of the improved EdgeNeXt network is constructed by adding residual blocks. The improved EdgeNeXt network is used to capture global and local information of the image.

[0052] The cross-view transformation encoder includes a BEV local window query module and a cross attention module. The cross-view transformation encoder is used to query image features across camera perspectives.

[0053] S2. Input the sample images into a lightweight semantic segmentation network for training;

[0054] S3. Determine whether the lightweight semantic segmentation network has been trained. If yes, proceed to step S4; otherwise, return to step S2 until the training is completed.

[0055] S4. Real-time acquisition of environmental images, inputting these images into a trained lightweight semantic segmentation network for semantic segmentation, and outputting the semantic segmentation results. This method enables feature querying across camera perspectives, guiding BEV queries to focus on the correct local regions, reducing query computation, and improving query accuracy and semantic segmentation efficiency.

[0056] In this embodiment, step S1 involves constructing a lightweight semantic segmentation network. This network includes an improved EdgeNeXt network, a cross-view transformation encoder, and a BEV feature decoder. Figure 1 As shown;

[0057] S11. Constructing the improved EdgeNeXt network includes Stage1, Stage2, Stage3, Stage4 modules and a feature pyramid module, such as... Figure 3 As shown;

[0058] The output of Stage 1 is connected to the input of Stage 2, the output of Stage 2 is connected to the input of Stage 3, the output of Stage 3 is connected to the input of Stage 4, and the outputs of Stage 2, Stage 3, and Stage 4 are connected to the input of the feature pyramid module.

[0059] S111. Construct the Stage1 module, which contains one 4×4 convolutional layer and three 3×3 convolutional encoders. The output of the convolutional layer is connected to the input of the convolutional encoder.

[0060] S112. Construct the Stage2 module. The Stage2 module contains one downsampling module, two 5×5 convolutional encoders, one position encoder, and one depth transpose attention encoder. The output of the downsampling module is connected to the input of the convolutional encoder. The outputs of the convolutional encoder and the position encoder are fused to obtain a fused feature map. The fused feature map is then input into the depth transpose attention encoder.

[0061] Convolutional encoders, position encoders, and depth transpose encoders are existing technologies and will not be described in detail here.

[0062] S113. Construct the Stage3 module, which includes one downsampling module, eight 7×7 convolutional encoders and one depth transpose attention encoder. The output of the downsampling module is connected to the input of the convolutional encoder, and the output of the convolutional encoder is connected to the input of the depth transpose attention encoder.

[0063] S114. Construct the Stage4 module, which includes one downsampling module, two 7×7 convolutional encoders and one depth transpose attention encoder. The output of the downsampling module is connected to the input of the convolutional encoder, and the output of the convolutional encoder is connected to the input of the depth transpose attention encoder.

[0064] S115. Construct a feature pyramid module. The feature pyramid module includes an upsampling module, a downsampling module, and a residual block. Specifically, the output of Stage 2 is downsampled, the output of Stage 4 is upsampled, and the downsampled output of Stage 2, the upsampled output of Stage 4, and the output of Stage 3 are concatenated. The concatenation result is then input into the residual block.

[0065] S12. Construct a cross-view transformation encoder. The cross-view transformation encoder divides the BEV grid into 4 windows based on the cross-attention view module. The cross-attention view module is an existing technology in CVT networks and will not be described in detail here. The cross-view transformation encoder determines the size of the BEV grid according to the sensor's sensing distance and the camera's resolution. For example, if the sensor's detection range is 50m and the camera resolution is 1024×1024, then the grid size can be [-51.2m, 51.2m] in the X direction, [-51.2m, 51.2m] in the Y direction, and [-5m, 3m] in the Z direction. The detection range is then divided into 1024×1024 windows of size 0.1m×0.1m in the X and Y directions. The BEV grid size is first reduced by downsampling. After the perspective coordinates are converted to BEV coordinates, the reduced grid size is restored by upsampling residual blocks.

[0066] The BEV query window using local window cross-attention does not associate with all perspectives. The BEV query within the window only performs cross-attention calculation with associated views, outputting a BEV feature map Z that fuses perspective features. The associated views are the perspectives corresponding to the BEV query, determined based on the sensor's field of view (FOV). For example, if the perspective corresponding to the BEV query appears in all three FOVs of the sensor, then each window performs cross-attention calculation with all three associated views. Figure 4 As shown;

[0067] The cross-attention between the perspective feature map and the BEV feature map is accomplished using the following method:

[0068] First, let the perspective feature T∈R N×H×W×C Transform into BEV features B∈R X×Y×C Where N represents the number of sensors, H represents the pixel height, W represents the pixel width, C represents the number of channels, X represents the grid length, and Y represents the grid width;

[0069] Secondly, the BEV coordinates B J Convert to perspective coordinates T J The conversion process is as follows:

[0070]

[0071]

[0072] Where u and v represent the BEV coordinates of the image, d represents the depth, and V represents the depth. J = (u,v,d), where u′ and v′ represent B J The BEV coordinates obtained after inputting the coordinates into the resize function, where I represents the camera intrinsic matrix and E represents the camera extrinsic matrix. -1 The inverse matrix representing the camera extrinsic parameters;

[0073] Then, cross-attention is performed by calculating the cosine similarity between the BEV coordinates of the perspective image backprojection and the BEV grid coordinates. The specific process is as follows:

[0074] A backprojection index of the perspective feature map is constructed based on the size of the perspective feature map, and K and V are obtained through a linear projection layer. The formulas for K and V are as follows:

[0075] K = M(EI) -1 T J′ )

[0076] V = M(T) J )

[0077] Where K represents the back projection index matrix, K∈R N×HW×d V represents the BEV image feature, V∈R NHW×d N represents the number of sensors, T J′ This represents the perspective coordinate transpose, where H represents pixel height, W represents pixel width, d represents depth, E represents camera extrinsic matrix, and I represents the perspective coordinate transpose. -1 The matrix represents the inverse of the camera intrinsic parameter matrix, M represents the linear projection layer, and T represents the inverse of the intrinsic parameter matrix. J Represents perspective coordinates;

[0078] Calculate cosine similarity:

[0079]

[0080] Where sim represents cosine similarity. Represents perspective coordinates, b J Denotes BEV coordinates, E represents the camera extrinsic parameter matrix, and K represents the BEV coordinates. -1 The matrix represents the inverse of the back projection index matrix, and n represents the number of views;

[0081] Finally, the feature map Z is output. The feature map Z is obtained by fusing the features of the BEV query and the corresponding perspective of the BEV query:

[0082] Z = CrossAttention(Q,K,V)

[0083] Where Z represents the feature map, Q represents the query window, K represents the back projection index matrix, and V represents the BEV image features;

[0084] S13. Construct a BEV feature decoder, which consists of upsampled residual blocks and a segmentation head. This method effectively reduces computation, guides BEV queries to focus on the correct local regions, and improves BEV resolution.

[0085] In this embodiment, in step S2, the acquired camera surround perspective view is input into a lightweight semantic segmentation network for training. The initial learning rate of the lightweight semantic segmentation network is set to 1e-4, the weight decay is 0.01, the batch size for training in a single pass is set to 8, the cross-entropy loss function is used, and the Adam optimizer is used. The formula for the cross-entropy loss function is as follows:

[0086]

[0087] Where A represents the total number of samples, b represents the number of target detection categories, and P ic y represents the predicted probability that sample i is c. ic This indicates whether sample i belongs to category c; if yes, c is set to 1, otherwise c is set to 0. This method effectively improves prediction accuracy and minimizes error.

[0088] In this embodiment, in step S3, it is determined whether all sample datasets have been input into the lightweight semantic segmentation network for 20 rounds of training. If yes, proceed to step S4; otherwise, return to step S2 and input all sample datasets into the lightweight semantic segmentation network for continued training until all sample datasets have completed 20 rounds of training. During each training iteration, the Adam optimizer in the lightweight semantic segmentation network updates the weight parameters. This method ensures that the prediction results of the lightweight semantic segmentation network achieve the required accuracy.

[0089] In this embodiment, in step S4, a six-camera surround view system is used to acquire real-time images of the vehicle's environment, and these images are then input into the trained lightweight semantic segmentation backbone network. Figure 3As shown, the image enters the Stage1 module, passes through a 4×4 convolutional layer, then through three 3×3 convolutional encoders, outputting feature map T1. Feature map T1 is then input to the Stage2 module, where it is downsampled by 8x and the number of channels is changed to 96. It then passes through two 5×5 convolutional encoders and one position encoder, followed by one depth transpose attention encoder to output feature map T2. Feature map T2 is then input to the Stage3 module, where it is downsampled by 16x and the number of channels is changed to 160. It then passes through eight 7×7 convolutional encoders and one depth transpose attention encoder to output feature map T3. Feature map T3 is then input to... In the Stage4 module, feature map T3 is downsampled by 32x and the number of channels is changed to 304. Feature map T4 is output through two 7×7 convolutional encoders and one depth transpose attention encoder. Feature map T2 is downsampled by 2x to obtain feature map T5. Feature map T4 is upsampled by 2x to obtain feature map T6. Feature maps T5, T3 and T6 are concatenated and the concatenated feature map is input into a residual block for feature aggregation, outputting feature map T7 with width and height downsampled by 16x. The backbone network EdgeNeXt outputs feature map T4 with width and height downsampled by 32x and feature map T7 with width and height downsampled by 16x.

[0090] Input feature map T4 and feature map T7 into the cross-view transformation encoder, such as Figure 2 As shown, feature map T4 and BEV query complete local window cross-attention, outputting BEV feature map B1. BEV feature map B1 is regularized to obtain BEV feature map B1′. BEV feature map B1′ is processed by a feedforward neural network to obtain BEV feature map B1″. BEV feature map B1′ and BEV feature map B1″ are added together, and then the added BEV feature map is regularized to output BEV feature map B1″′. Feature map T7 and BEV query complete local window cross-attention, outputting BEV feature map B2. BEV feature map B2 is added to BEV feature map B1″′, and then the added BEV feature map is regularized to output BEV feature map B2′. BEV feature map B2′ is processed by a feedforward neural network to obtain BEV feature map B2″. BEV feature map B2′ and BEV feature map B2″ are added together, and then the added BEV feature map is regularized to output BEV feature map B2″′.

[0091] The BEV feature map B1″′ and BEV feature map B2″′ are input into the BEV feature decoder. After passing through 3 upsampled residual blocks and 1 segmentation head, the semantic segmentation result is output.

[0092] 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, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A lightweight semantic target segmentation method based on local window cross-attention, characterized in that: Includes the following steps: S1. Construct a lightweight semantic segmentation network, which includes an improved EdgeNeXt network, a cross-view transformation encoder, and a BEV feature decoder; The improved EdgeNeXt network serves as the backbone network. The feature pyramid of the improved EdgeNeXt network is constructed by adding residual blocks. The improved EdgeNeXt network is used to capture global and local information of the image. The cross-view transformation encoder includes a BEV local window query module and a cross attention module. The cross-view transformation encoder is used to query image features across camera perspectives. The BEV feature decoder consists of upsampled residual blocks and a segmentation head, used to complete semantic segmentation; In step S1, the cross-view transformation encoder determines the size of the BEV grid based on the sensor's sensing distance and the camera's resolution, divides the BEV grid into four windows, and performs cross-attention calculation on the BEV query and the corresponding perspective view within each window, outputting a BEV feature map that fuses perspective view features. ; The cross-attention between the perspective feature map and the BEV feature map is accomplished using the following method: First, the perspective features Convert to BEV features ,in, Indicates the number of sensors. Indicates pixel height, Indicates pixel width, Indicates the number of channels. Indicates the length of the grid. Indicates the width of the grid; Secondly, the BEV coordinates Convert to perspective coordinates The conversion process is as follows: in, and Represents the BEV coordinates of the image. Indicates depth, , and express The BEV coordinates are obtained after inputting the coordinates into the resize function. This represents the camera intrinsic parameter matrix. Represents the camera extrinsic parameter matrix. The inverse matrix representing the camera extrinsic parameters; Then, cross-attention is performed by calculating the cosine similarity between the BEV coordinates of the perspective image backprojection and the BEV grid coordinates. The specific process is as follows: Construct a perspective feature map backprojection index based on the size of the perspective feature map, and obtain it through a linear projection layer. and , and The formula is as follows: in, Represents the back projection index matrix. , Representing BEV image features, N represents the number of sensors. This indicates the perspective coordinate transpose. Indicates pixel height, Indicates pixel width, Indicates depth, Represents the camera extrinsic parameter matrix. This represents the inverse of the camera intrinsic parameter matrix. Indicates a linear projection layer. Represents perspective coordinates; Calculate cosine similarity: in, Represents cosine similarity. Represents perspective coordinates. Represents BEV coordinates, Represents the camera extrinsic parameter matrix. This represents the inverse of the back projection index matrix. Indicates the number of views; Finally, output feature map Feature map This is obtained by fusing features from BEV queries and their corresponding perspectives: in, Representing feature maps, The window that represents the query. Represents the back projection index matrix. Represents BEV image features; S2. Input the sample images into a lightweight semantic segmentation network for training; S3. Determine whether the lightweight semantic segmentation network has been trained. If yes, proceed to step S4; otherwise, return to step S2 until the training is completed. S4. Real-time acquisition of environmental images, input of environmental images into a trained lightweight semantic segmentation network for semantic segmentation, and output of semantic segmentation results.

2. The lightweight semantic target segmentation method based on local window cross-attention as described in claim 1, characterized in that: In step S1, the EdgeNeXt network is constructed using the following method: The EdgeNeXt network includes Stage1, Stage2, Stage3, Stage4 modules and a feature pyramid module; The output of Stage 1 is connected to the input of Stage 2, the output of Stage 2 is connected to the input of Stage 3, the output of Stage 3 is connected to the input of Stage 4, and the outputs of Stage 2, Stage 3, and Stage 4 are connected to the input of the feature pyramid module. S111. Construct the Stage1 module, which contains a 4×4 convolutional layer and a 3×3 convolutional encoder. The output of the convolutional layer is connected to the input of the convolutional encoder. S112. Construct the Stage2 module. The Stage2 module includes a downsampling module, a 5×5 convolutional encoder, a position encoder, and a depth transpose attention encoder. The output of the downsampling module is connected to the input of the convolutional encoder. The outputs of the convolutional encoder and the position encoder are fused to obtain a fused feature map. The fused feature map is then input into the depth transpose attention encoder. S113. Construct the Stage3 module, which includes a downsampling module, a 7×7 convolutional encoder, and a depth transpose attention encoder. The output of the downsampling module is connected to the input of the convolutional encoder, and the output of the convolutional encoder is connected to the input of the depth transpose attention encoder. S114. Construct the Stage4 module, which includes a downsampling module, a 7×7 convolutional encoder, and a depth transpose attention encoder; S115. Construct a feature pyramid module, which includes an upsampling module, a downsampling module, and a residual block. Specifically, the output of Stage 2 is downsampled, the output of Stage 4 is upsampled, and the downsampled output of Stage 2, the upsampled output of Stage 4, and the output of Stage 3 are concatenated. The concatenation result is then input into the residual block.

3. The lightweight semantic target segmentation method based on local window cross-attention as described in claim 1, characterized in that: In step S2, the initial learning rate of the lightweight semantic segmentation network is set to 1e-4, the weight decay is 0.01, the batch size for training in a single pass is set to 8, the cross-entropy loss function is used, and the Adam optimizer is used. The formula for the cross-entropy loss function is as follows: in, This indicates the total number of samples. Indicates the number of target detection categories. This represents the predicted probability that sample i is c. This indicates whether sample i belongs to category c. If yes, c is 1; otherwise, c is 0.

4. The lightweight semantic target segmentation method based on local window cross-attention as described in claim 1, characterized in that: In step S3, the lightweight semantic segmentation network training is completed when the sample dataset has completed 20 rounds of training.

Citation Information

Patent Citations

  • Geometric prior-based aerial view semantic segmentation method, apparatus and device, and medium

    CN115965969A

  • Method and system for realizing aerial view semantic segmentation based on implicit set prediction

    CN115965970A