Squeeze-enhanced axial transformer, its layer and methods thereof
AssigneeFudan University
InventorsLi Zhang, Qiang Wan, Jiachen Lu, Zilong Huang, Gang Yu
Life of this patent
Estimating the term…
Abstract
A squeeze-enhanced axial transformer (SeaFormer) for mobile semantic segmentation is disclosed, including a shared stem, a context branch, a spatial branch, a fusion module and a light segmentation head, wherein the shared stem produces a feature map; the context branch obtains context-rich information; the spatial branch obtains spatial information; the fusion module incorporates the features in the context branch into the spatial branch; and the light segmentation head receives the feature from the fusion module and output the results. This application is also related to the layer of the SeaFormer, as well as methods thereof.
Claims20
A squeeze-enhanced axial transformer for mobile semantic segmentation, including
- a shared stem,
- a context branch,
- a spatial branch,
- a fusion module and
- a light segmentation head, wherein
- the shared stem produces a feature map which is shared by the context branch and the spatial branch;
- the context branch obtains context-rich information from the feature map;
- the spatial branch obtains spatial information in high resolution from the feature map;
- the fusion module incorporates the features in the context branch into the spatial branch, fusing high-level context-rich information into low-level spatial information;
- and
- the light segmentation head receives the feature from the fusion module and output the results;
- wherein the context branch includes three stages, the second and the third one of the three stages each containing a first MobileNet block and a squeeze-enhanced axial transformer (SeaFormer) layers block stacked after the first MobileNet block;
- said SeaFormer layers block comprising one or more SeaFormer layers, wherein said one or more SeaFormer layers each includes a squeeze-enhanced axial attention module and a Feed-Forward Network (FFN);
- wherein the squeeze-enhanced axial attention module comprises a detail enhancement kernel and a squeeze axial attention sub-module;
- the detail enhancement kernel is in multiplication with the squeeze axial attention sub-module to form the squeeze-enhanced axial attention module;
- the detail enhancement kernel comprises a concatenation block, a first convolution and batch normalization block, an activation layer and a second convolution and batch normalization block arranged in series;
- the squeeze axial attention sub-module comprises a horizontal squeeze block and a vertical squeeze block, wherein said horizontal squeeze block and said vertical squeeze block are arranged in parallel, and said horizontal squeeze block is followed by a first multi-head attention block, while said vertical squeeze block is followed by a second multi-head attention block;
- and
- the squeeze axial attention sub-module further comprises a first convolutional layer, wherein the outputs of the two multi-head attention block are broadcasted and then added in element-wise, and then input to the first convolutional layer;
- wherein query key value projections of the input feature are concatenated on the channel dimension in the concatenation block of the detail enhancement kernel, and then passed to the first convolution and batch normalization block;
- and
- wherein the query key value projections of the input feature are taken average on the horizontal direction in the horizontal squeeze block, and taken average on the vertical direction in the vertical squeeze block.
A method for mobile semantic segmentation by using squeeze-enhanced axial transforming, comprising the steps of:
- producing a feature map from an input image;
- obtaining context-rich information from the feature map;
- obtaining spatial information in high resolution from the feature map;
- fusing the context-rich information into low-level spatial information;
- and
- inputting the fusion result to a light segmentation head and then outputting the results;
- wherein obtaining the context-rich information includes three stages, the second and third one of the three stages each contains conducting operation in a MobileNet block and a squeeze-enhanced axial transformer (SeaFormer) layers block successively;
- the operation in said SeaFormer layers block comprises conducting one or more above-mentioned squeeze-enhanced axial transforming;
- said squeeze-enhanced axial transforming including:
- extracting query key value projections from the input feature;
- conducting detail enhancement, which includes, concatenating the query key value projections on the channel dimension, and then, to the concatenation output, conducting 3×3 depth-wise convolution, batch normalization, activation, 1×1 convolution, and batch normalization successively;
- conducting squeeze axial attention, which includes
- taking average of the query key value projections on the horizontal direction, and then conducting a multi-head attention to its output;
- taking average of the query key value projections on the vertical direction, and then conducting a multi-head attention to its output;
- broadcasting the outputs of both multi-head attention, and then conducting an element-wise addition;
- and
- inputting the output of addition into a 1×1 convolution;
- and
- multiplying the outputs of the detail enhancement and squeeze axial attention, and then inputting the multiplication output to a Feed-Forward Network.
Dependencies are inferred from the claim text.