Image feature extraction method based on one-way visual state space
By employing a method of parallel fusion of all features and multiple learnable classification labels, the problems of insufficient local spatial information modeling and orientation bias in unidirectional visual state space methods are solved, achieving more efficient image feature extraction and global feature reading.
Patent Information
- Application Number
- CN202611205691.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-11-20
AI Technical Summary
Existing unidirectional vision state space methods suffer from insufficient modeling of local spatial information in image feature extraction, incomplete information due to parallel branching, directional bias caused by fixed scanning order, and limited ability to read global information from a single learnable classification label.
The method of parallel fusion of full features and multiple learnable classification labels is adopted. Image patch labels and learnable classification labels are input into the unidirectional state space processing branch and the local space feature processing branch, respectively. By selective flipping and element-wise addition fusion, the local space modeling ability is enhanced and the directional bias is reduced, thereby improving the global feature reading ability.
It improves the accuracy and efficiency of image feature extraction, reduces computational overhead, and enhances the ability to model local space and read global features.
Smart Images

Figure CN123141965A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and deep learning technology, and specifically relates to an image feature extraction method based on a unidirectional visual state space. Background Technology
[0002] With the development of deep learning technology, convolutional neural networks (CNNs), visual Transformers, and visual state-space models have been widely applied to visual tasks such as image classification, object detection, and image segmentation. CNNs can effectively extract local spatial features of images, but their ability to model long-distance dependencies is limited. Visual Transformers establish global feature relationships through a self-attention mechanism, but their computational and storage costs increase significantly with the number of image labels. Visual state-space models can process image label sequences with linear complexity, providing a new approach for efficient visual feature extraction.
[0003] Existing visual state space models typically employ bidirectional or multidirectional scanning to enhance the interaction of contextual information in different directions, but repeated scanning increases computational overhead. Unidirectional scanning processes image tags only along a predetermined direction, offering better computational efficiency, but still suffers from the following problems:
[0004] (1) After the image is converted into a one-dimensional labeled sequence, the model lacks an explicit two-dimensional local space prior. Some existing parallel hybrid methods divide the input features according to the channel dimension and feed them into the convolution branch and the state space branch respectively, so that each branch can only obtain part of the channel features, which easily leads to the dispersion of feature information;
[0005] (2) When image tags are always scanned unidirectionally in a fixed order, the context range obtained by tags at different positions is inconsistent, which can easily lead to scanning direction bias. If the image block tags and learnable classification tags of each processing branch are flipped uniformly in the parallel structure, it will disturb the correspondence between the image block tags and the original two-dimensional spatial positions in the local spatial feature processing branch, and change the tail arrangement of the learnable classification tags in the sequence to be processed, thereby affecting the extraction of local spatial features and the reading of global features;
[0006] (3) Existing methods usually use a single learnable classification label to aggregate the information of the whole image, which can easily form a global feature reading bottleneck and cannot make full use of the context information gradually accumulated during the unidirectional scanning process.
[0007] Therefore, a new image feature extraction method is needed that, while maintaining the computational characteristics of unidirectional scanning, enhances the ability to model local space, reduces the directional bias caused by fixed scanning order, and improves the ability to read global image features. Summary of the Invention
[0008] The purpose of this invention is to provide a unidirectional visual state space image feature extraction method based on full-feature parallel hybridization and multiple learnable classification labels, which solves the problems of insufficient local spatial information modeling, incomplete information caused by parallel branching features, directional bias caused by fixed scanning order, and limited global information reading capability of a single learnable classification label in existing unidirectional visual state space methods.
[0009] The technical solution for achieving the objective of this invention is: an image feature extraction method based on a unidirectional visual state space, comprising:
[0010] The image to be extracted is divided into several non-overlapping image blocks according to a preset size, and each image block is converted into an image block label through an image block mapping operation. At the same time, position encoding is added to the image block label to obtain an image block label sequence.
[0011] Several independent learnable classification labels are generated, and corresponding position codes are configured for each learnable classification label. The learnable classification labels are then sequentially placed at the end of the image patch label sequence to obtain the label sequence to be processed.
[0012] A full-feature parallel processing path is used to extract features from the labeled sequence to be processed. The full-feature parallel processing path includes several sequentially connected feature extraction units. Each feature extraction unit includes a parallel unidirectional state space processing branch and a local space feature processing branch. The unidirectional state space processing branch receives image patch labels and learnable classification labels, and is used to perform unidirectional context information modeling along the label sequence to obtain an updated label sequence. The local space feature processing branch receives image patch labels, restores the image patch labels to a two-dimensional feature arrangement, extracts local space features through depthwise convolution, and then flattens them back into an image patch label sequence.
[0013] Each feature extraction unit fuses the image patch labels updated by the unidirectional state space processing branch with the image patch labels processed by the local space feature processing branch by adding them element by element. The fused image patch labels and the learnable classification labels updated by the unidirectional state space processing branch are then combined to form an output label sequence, which is then input into the next feature extraction unit after channel feature transformation to complete the layer-by-layer feature extraction.
[0014] Image patch labels and learnable classification labels are extracted from the label sequence output by the feature extraction unit.
[0015] Compared with the prior art, the significant advantages of this invention are:
[0016] (1) Instead of dividing the input features into channels and sending them to different branches, this invention simultaneously inputs the image block features with complete channel dimensions into the unidirectional state space processing branch and the local space feature processing branch, so that the unidirectional state space processing branch and the local space feature processing branch perform global context modeling and local space modeling based on the complete channel features, respectively, thus avoiding information dispersion and feature loss caused by channel splitting.
[0017] (2) This invention does not perform flipping on the complete label sequence or all parallel branches uniformly, but only selectively flips the image block labels in the unidirectional state space processing branch. The learnable classification labels and local spatial feature processing branches maintain their original order, thereby reducing the fixed scanning direction bias while avoiding the destruction of local spatial adjacency relationships and the global reading process of the tail learnable classification labels.
[0018] (3) This invention does not compress the global information of the entire image using only a single learnable classification label, but instead sets multiple learnable classification labels at the end of the image block label sequence, enabling each learnable classification label to receive the contextual information formed by the preceding image block labels, and allowing the later learnable classification labels to further accumulate the global representation in the preceding labels; by selecting a preset number of later learnable classification labels to form global image features, the global feature reading capability is improved and the information bottleneck caused by a single learnable classification label is reduced. The invention will be further described in detail below with reference to the accompanying drawings. Attached Figure Description
[0019] Figure 1 This is a flowchart of the present invention.
[0020] Figure 2 This is a schematic diagram of the structure of the parallel feature extraction module.
[0021] Figure 3 A schematic diagram of a unidirectional state space modeling structure.
[0022] Figure 4 This is a schematic diagram of the branch for processing local spatial features. Detailed Implementation
[0023] like Figure 1 As shown, a method for extracting features from a unidirectional visual state space image based on parallel fusion of full features and multiple learnable classification labels specifically includes the following steps:
[0024] Image segmentation and label generation. The image to be extracted is obtained, and the input image is divided into multiple non-overlapping image blocks according to the preset image block size p×p. Each image block is converted into an image block label through an image block mapping operation. Based on the spatial position of each image block in the input image, a positional code is added to the corresponding image block label to obtain an image block label sequence.
[0025] Construction of multiple learnable classification labels at the tail. Multiple independent trainable feature vectors are set as learnable classification labels, each with independent parameters, which are updated together with the network parameters during model training. The feature dimensions of each learnable classification label are consistent with those of the image patch labels, and corresponding positional encodings are configured for each. These multiple learnable classification labels are sequentially placed at the tail of the image patch label sequence according to a preset order, forming a label sequence to be processed consisting of image patch labels and tail learnable classification labels. This allows the learnable classification labels to converge the contextual information contained in the preceding image patch labels during subsequent unidirectional state space modeling.
[0026] A full-feature parallel processing path is constructed. This path comprises several sequentially connected feature extraction units. Each feature extraction unit includes a parallel unidirectional state-space processing branch and a local spatial feature processing branch. In each feature extraction unit, image patch labels with full channel dimensions are simultaneously input into both the unidirectional state-space processing branch and the local spatial feature processing branch, without channel splitting of the image patch labels. The unidirectional state-space processing branch receives image patch labels and learnable classification labels, and is used to model unidirectional context information along the label sequence to extract the global context information of the image. The local spatial feature processing branch only receives image patch labels, restores the image patch labels to a two-dimensional feature arrangement, extracts the local spatial information between adjacent image patches through depthwise convolution, and then flattens it back into an image patch label sequence. Learnable classification labels do not have corresponding two-dimensional spatial positions, therefore they do not enter the local spatial feature processing branch.
[0027] In a further embodiment, the unidirectional state space processing branch in the defined feature extraction unit includes a selective flipping part and a unidirectional state space modeling part.
[0028] Among the remaining feature extraction units, the unidirectional state space processing branch includes the unidirectional state space modeling part.
[0029] The image patch labels in the local spatial feature processing branch are not flipped in order to maintain the original two-dimensional spatial adjacency relationship between image patches.
[0030] The selective flipping section performs selective flipping on image patch labels. Specifically, before the image patch labels enter the unidirectional state space modeling section, the arrangement order of the image patch labels is flipped along the sequence dimension. After completing the unidirectional state space modeling, the output image patch labels are flipped again to restore their original arrangement order. By changing the unidirectional context propagation direction of the image patch labels in different feature extraction units, the directional bias caused by always performing unidirectional modeling in a fixed arrangement order can be reduced. By restoring the original arrangement order after modeling, the image patch labels output by this branch can maintain positional correspondence with the image patch labels output by the local spatial feature processing branch, facilitating subsequent position-by-position feature fusion. Learnable classification labels are not flipped in the above process to maintain their arrangement structure at the end of the image patch label sequence and the global information convergence process.
[0031] The one-way state space modeling part uses image patch labels and learnable classification labels to complete the one-way state space processing.
[0032] Specifically, selective flipping of image patch labels is performed, reversing the order of image patch labels along the sequence dimension, while the learned classification labels maintain their original order. For example: the sequence of labels to be processed before flipping is [ ],in, to Indicates image block markers arranged in their original spatial order. and The learnable classification label located at the end of the sequence is represented; after selective flipping, the label sequence becomes [ After completing the unidirectional state space processing, the output image patch labels are reversed again to restore their original arrangement order corresponding to the local spatial feature processing branches, i.e., [ ].
[0033] In a further embodiment, in the feature extraction unit that does not perform selective flipping, the image patch labels and learnable classification labels enter the unidirectional state space processing branch and directly complete the unidirectional state space processing to obtain the processed label sequence.
[0034] In a further embodiment, the selective flipping portion is set once every other feature extraction unit.
[0035] In a further embodiment, the unidirectional state space modeling part includes an input feature mapping layer, a one-dimensional sequence convolutional layer, a state space modeling layer, a gating processing layer, a normalization layer, and an output feature mapping layer, such as... Figure 3As shown, each image patch label and each learnable classification label in the label sequence to be processed are input as a whole into the input feature mapping layer. The input feature mapping layer processes each label in the sequence according to the same mapping method, and divides the mapping result into content features and gating features along the feature dimension, so that each image patch label and each learnable classification label generates a set of content features and a set of gating features. The content features are input into the state space modeling layer after one-dimensional sequence convolution and nonlinear activation by the one-dimensional sequence convolution layer, and context information is modeled according to the arrangement direction of the label sequence to be processed. The gating features are multiplied element-wise with the features output by the state space modeling layer after nonlinear activation by the gating processing layer. The multiplication result is normalized by the normalization layer and output feature mapping layer to obtain the updated label sequence. For the feature extraction unit configured to perform selective flipping, the image patch labels are flipped in arrangement order and restored to their original order before entering the unidirectional state space modeling part and after modeling is completed, respectively.
[0036] In a further embodiment, the local spatial feature processing branch includes a two-dimensional spatial recovery layer, a depthwise convolutional layer, and a sequence flattening layer, such as... Figure 4 As shown. The local spatial feature processing branch only receives image patch labels and does not receive learnable classification labels. The two-dimensional spatial restoration layer restores the one-dimensional image patch label sequence into a two-dimensional feature arrangement based on the row and column positions of each image patch label in the input image; the deep convolutional layer uses a 3x3 deep convolution kernel to perform channel-by-channel local spatial modeling of image patch features at adjacent positions in the two-dimensional features; the sequence flattening layer flattens the two-dimensional features after local spatial modeling back into a one-dimensional image patch label sequence according to the original arrangement order of the image patch labels. The number of image patch labels and the channel dimension remain consistent before and after processing to ensure corresponding fusion with the image patch labels output by the unidirectional state space processing branch.
[0037] Parallel feature fusion and layer-by-layer propagation. The image patch labels updated by the unidirectional state space processing branch and the image patch labels output by the local spatial feature processing branch are fused element-wise. The fused image patch labels and the learnable classification labels updated by the unidirectional state space processing branch are then combined to form the output label sequence, which is then processed by channel feature transformation and input into the next feature extraction unit to complete layer-by-layer feature extraction.
[0038] Feature extraction and visual task output. After completing the processing of all feature extraction units, image patch labels and learnable classification labels are extracted from the final output label sequence. Corresponding feature extraction methods are adopted for different visual tasks.
[0039] In some embodiments, for image classification tasks, a predetermined number of learnable classifiers are selected from the output learnable classifier sequence. When the total number of learnable classifiers is R, the last R / 2 learnable classifiers are selected, and the feature vectors corresponding to the selected R / 2 learnable classifiers are concatenated sequentially along the feature dimension according to their original arrangement in the output learnable classifier sequence to obtain the global image features. The global image features are no longer concatenated with image patch labels, but are directly input into the image classification module to obtain the image classification result; the remaining unselected learnable classifiers do not participate in the construction of the global image features.
[0040] In some embodiments, for semantic segmentation tasks, intermediate output label sequences are obtained from the 3rd, 6th, 9th, and 12th feature extraction units. Learnable classification labels are removed from each output label sequence, retaining only image patch labels. Based on the row and column positions of the image patch labels in the input image, each layer of image patch labels is reconstructed into a two-dimensional feature map. These two-dimensional feature maps of different depths are then input into the semantic segmentation module to complete pixel-level category prediction.
[0041] In some embodiments, for object detection and instance segmentation tasks, an output label sequence is obtained from the final feature extraction unit, learnable classification labels are removed, and the remaining image patch labels are restored into a two-dimensional feature map according to their corresponding spatial locations. Based on the two-dimensional feature map, feature representations with different spatial scales are generated, and the feature representations are input into the object detection or instance segmentation module, which outputs the target location, target category, or instance mask.
[0042] Using the above reading method, classification labels can be learned to form global features required for image classification tasks, and image patch labels can be learned to form two-dimensional spatial features required for object detection, semantic segmentation, and instance segmentation tasks.
[0043] Evaluation results:
[0044] The name of this invention is UniFMamba:
[0045] 1. Image classification task
[0046] To verify the feature extraction performance of the method of this invention in large-scale natural image classification scenarios, ImageNet-1K, a large-scale image classification dataset containing one thousand image categories, was used for training and testing. Input images were uniformly adjusted to 224×224 pixels, and the described method was followed sequentially to complete image segmentation, tail-end multi-learnable classification label construction, parallel processing of all features, selective flipping, feature fusion, and classification feature reading. Image classification performance was evaluated by the highest classification accuracy; simultaneously, the model parameter count, image processing throughput, and GPU memory usage were statistically analyzed to evaluate the model's computational efficiency. Throughput and GPU memory usage were measured under the same graphics processor and the same batch processing scale.
[0047] To comprehensively evaluate the method of this invention, it is compared with the following four types of visual feature extraction models:
[0048] 1. Convolutional neural network models, including residual network models ResNet-50 and ResNet-152, as well as modern convolutional network models ConvNeXt, are mainly used to compare the classification performance of local convolution modeling methods;
[0049] 2. Visual transformer models, including the visual transformer model ViT-B and the data-efficient image transformer model DeiT, are mainly used to compare methods for modeling global information based on the self-attention mechanism (Transformer);
[0050] 3. Pure state-space models, including bidirectional / multidirectional vision state-space models ViM and PlainMamba, and the unidirectional vision state-space model Adventurer. Among these, Adventurer, like this invention, uses unidirectional state-space modeling and is the main comparative method for evaluating the improvement effect of this invention.
[0051] 4. Hybrid models of state-space models and convolutional neural networks, including VMamba and MobileMamba. VMamba employs multi-directional scanning, while MobileMamba uses parallel state-space and convolutional branches but performs channel partitioning of the input features. This invention, however, inputs the image patch features of the complete channel simultaneously into two parallel branches to compare the effects of different scanning methods and different parallel feature organization methods. The results are shown in Table 1.
[0052] Table 1. Results of the image classification task (where T / S / B represent lightweight / small / basic types, respectively).
[0053] Model Number of parameters (millions) Throughput (frames / second) Video memory usage (gigabytes) Accuracy (%) ResNet-50 25 737 6.6 76.2 ResNet-152 60 357 12.5 78.3 ConvNeXt-T 29 332 8.3 82.1 ConvNeXt-S 50 225 13.1 83.1 ViT-B 86 90 >48 77.9 DeiT-T 5 1987 3.4 72.2 DeiT-S 22 861 14.4 79.8 DeiT-B 86 324 >48 81.8 ViM-T 7 382 8.3 76.1 ViM-S 26 215 16.4 80.5 ViM-B 98 121 33.0 81.9 PlainMamba-T 7 256 9.2 77.9 PlainMamba-S 25 193 6.3 81.6 PlainMamba-B 20 92 28.5 82.3 Adventurer-T 12 12 4.2 77.8 Adventurer-S 44 44 8.3 80.9 Adventurer-B 99 99 13.0 81.4 VMamba-T 31 312 14.9 82.5 VMamba-S 50 191 26.7 83.6 MobileMamba-S 15 2106 2.0 78.0 MobileMamba-B 17 1394 3.3 79.9 UniFMamba-T 13 906 4.6 79.4 UniFMamba-S 47 465 9.1 82.1 UniFMamba-B 103 273 14.1 82.7
[0054] Experimental results show that the highest classification accuracy of the model of this invention reaches 79.4%, 82.1%, and 82.7% for the three scales, respectively. Compared with Adventurer, which corresponds to the structural scale, the classification accuracy is improved by 1.6, 1.2, and 1.3 percentage points, respectively.
[0055] In comparison with the three pure state-space models, the lightweight model of this invention achieved a classification accuracy of 79.4%, which is 3.3, 1.5 and 1.4 percentage points higher than ViM-T, PlainMamba-L1 and MobileMamba-S6 which uses a channel partitioning parallel structure, respectively. This indicates that applying global sequence modeling and local spatial modeling to complete image patch features simultaneously is more beneficial to improving classification accuracy than using only state-space modeling or dividing features into different parallel branches.
[0056] In comparison with multi-directional state-space models, the highest classification accuracy of the medium-sized model in this invention is 82.1%, lower than VMamba-S's 83.6%, but its throughput of 465 images per second is higher than VMamba-S's 191 images per second, approximately 2.4 times higher; its memory usage is 9.1 gigabytes, also significantly lower than VMamba-S's 26.7 gigabytes. Therefore, this invention does not solely aim to achieve the highest classification accuracy among all models, but rather balances classification accuracy, processing speed, and memory consumption while maintaining a unidirectional scanning structure.
[0057] 2. Semantic segmentation task
[0058] To verify the feature extraction performance of the method of this invention in pixel-level scene understanding tasks, semantic segmentation tests were conducted using the ADE20K scene parsing dataset. During the test, the input image was adjusted to 512×512 pixels, image features were extracted according to the method described above, and the output label sequence was obtained from the preset feature extraction unit. After removing the learnable classification labels, the remaining image patch labels were restored to two-dimensional feature maps, which were then input into the unified perception parsing network for pixel-level category prediction.
[0059] Representative models from the aforementioned different types of visual feature extraction models are selected for comparison, including convolutional neural network models, visual transformer models, and visual state space models. The method of this invention is compared with unidirectional visual state space comparison methods with the same parameter scale.
[0060] Mean Intersection over Union (mIoU) is used to evaluate semantic segmentation performance. The mean IoU is calculated as the ratio of the intersection area and the union area between the predicted region and the ground truth region for each semantic category, and then averaged over all categories. The higher the mean IoU, the closer the pixel-level classification result is to the ground truth segmentation region, and the better the semantic segmentation performance.
[0061] Table 2 Semantic Segmentation Tasks
[0062] Model Number of parameters (millions) mIoU (%) ResNet-50 64 42.0 ResNet-101 83 43.8 DeiT-T 33 40.1 DeiT-S 51 44.0 DeiT-B 119 45.5 ViM-T 16 41.2 ViM-S 48 45.0 Adventurer-T 20 42.1 Adventurer-S 56 45.8 Adventurer-B 115 46.6 UniFMamba-T 20 43.3 UniFMamba-S 56 46.5 UniFMamba-B 115 47.2
[0063] As shown in Table 2, the average crossover ratio (CROR) of the small-scale model of this invention reaches 46.5%. With the same number of parameters (56 million), this is 0.7 percentage points higher than that of the same-scale unidirectional visual state space comparison model.
[0064] Compared with small-scale data-efficient image transformers and small-scale visual state-space models, the average intersection-union ratio (IU / R) of the small-scale model in this invention is improved by 2.5 percentage points and 1.5 percentage points, respectively; compared with a 50-layer residual network with 64 million parameters, it is improved by 4.5 percentage points. These results demonstrate that the method of this invention can simultaneously preserve sufficient global contextual information and local spatial information, thereby improving the discriminative power between different semantic regions and the pixel classification effect near the target boundary.
[0065] 3. Object detection and instance segmentation tasks
[0066] To verify the feature extraction performance of the method of this invention in target localization and pixel-level instance recognition scenarios, the COCO 2017 target detection and instance segmentation dataset was used for testing. During the test, features were extracted from the input image according to the method described above. Learnable classification labels were removed from the label sequence output by the last feature extraction unit, and the remaining image patch labels were restored into two-dimensional feature maps according to their corresponding spatial locations. Feature representations at different spatial scales were constructed based on the two-dimensional feature maps, and then input into a cascaded mask region convolutional neural network, which outputs the target bounding box, target category, and instance mask, respectively.
[0067] Representative models from the aforementioned different types of visual feature extraction models were selected for comparison, including convolutional neural network models, visual transformer models, visual state space models, and a hybrid model combining state space models and convolutional neural networks. All models used the same downstream task processing network and training settings to compare the performance of different feature extraction methods in object detection and instance segmentation tasks.
[0068] Using the average accuracy of bounding boxes ( ) and average mask precision ( The target detection performance and instance segmentation performance are evaluated separately. Here, the intersection-union ratio (IU) represents the ratio of the intersection area to the union area of the predicted region and the ground truth region; the average bounding box accuracy represents the average value of the target bounding box detection accuracy calculated across multiple IU thresholds; and the average mask accuracy represents the average value of the instance mask prediction accuracy calculated across multiple IU thresholds.
[0069] Average accuracy when the intersection-union ratio threshold is 0.50 ( This mainly reflects the model's ability to correctly identify and roughly locate targets; the average accuracy when the intersection-union ratio threshold is 0.75 ( The more stringent matching conditions are used, primarily reflecting the model's ability to accurately locate target boundaries and instance regions. Higher values for these metrics indicate better target detection or instance segmentation performance.
[0070] Table 3 Object Detection and Instance Segmentation Tasks
[0071] Model ResNet-50 41.2 59.4 45.0 35.9 56.6 38.4 ResNet-101 42.9 61.0 46.6 37.3 58.2 40.1 DeiT-T 44.4 63.0 47.8 38.1 59.9 40.5 DeiT-S 44.7 65.8 48.3 39.9 62.5 42.8 DeiT-B 47.2 66.3 51.5 41.8 64.7 44.9 ViM-T 45.7 63.9 49.6 39.2 60.9 41.7 Adventurer-T 46.5 65.2 50.4 40.3 62.2 43.5 Adventurer-S 47.8 66.7 51.8 41.5 63.9 44.5 Adventurer-B 48.4 67.2 52.4 42.0 64.8 45.0 MobileMamba-B 40.6 61.8 43.8 37.4 58.9 39.9 UniFMamba-T 47.7 66.0 51.6 41.1 63.3 44.1 UniFMamba-S 48.9 67.5 52.7 42.2 64.9 45.4 UniFMamba-B 49.7 68.5 53.6 42.7 65.7 45.9
[0072] As shown in Table 3, the average accuracy of the bounding box of the small model of this invention reaches 48.9%, and the average accuracy of the mask reaches 42.2%. Compared with the small one-way vision state space contrast model, the average accuracy of the bounding box is improved by 1.1 percentage points, and the average accuracy of the mask is improved by 0.7 percentage points.
[0073] When the intersection-over-union (IoU) threshold is 0.50, the average accuracy of the bounding box and the average accuracy of the mask in the small-scale model of this invention reach 67.5% and 64.9%, respectively, which are 0.8 percentage points and 1.0 percentage points higher than the small-scale unidirectional visual state space contrast model. When the IoU threshold is 0.75, the accuracy reaches 52.7% and 45.4%, respectively, both improving by 0.9 percentage points. This shows that the method of this invention can not only improve the recognition ability of targets and instances, but also improve the accurate localization ability of target bounding boxes and instance masks.
[0074] Compared to efficient image transformers for small data, the small-scale model of this invention improves the average accuracy of bounding boxes and the average accuracy of masks by 4.2 and 2.3 percentage points, respectively; compared to the comparative model employing a parallel hybrid structure of state space branching and convolutional branching, the improvements are 8.3 and 4.8 percentage points, respectively. These results demonstrate that simultaneously using full-channel dimension image patch labeling for unidirectional context modeling and local spatial modeling can enhance global semantic information and local boundary information in image features, thereby improving the processing performance of object detection and instance segmentation tasks.
Claims
1. An image feature extraction method based on a unidirectional visual state space, characterized in that, include: The image to be extracted is divided into several non-overlapping image blocks according to a preset size, and each image block is converted into an image block label through an image block mapping operation. At the same time, position encoding is added to the image block label to obtain an image block label sequence. Several independent learnable classification labels are generated, and corresponding position codes are configured for each learnable classification label. The learnable classification labels are then sequentially placed at the end of the image patch label sequence to obtain the label sequence to be processed. The full-feature parallel processing path is used to extract features from the labeled sequence to be processed. The full-feature parallel processing path includes several sequentially connected feature extraction units. Each feature extraction unit includes a parallel unidirectional state space processing branch and a local space feature processing branch. The unidirectional state space processing branch receives image patch labels and learnable classification labels, and is used to model unidirectional context information along the label sequence to obtain an updated label sequence; the local spatial feature processing branch receives image patch labels, restores the image patch labels to a two-dimensional feature arrangement, extracts local spatial features through depth convolution, and then flattens them back into an image patch label sequence. Each feature extraction unit fuses the image patch labels updated by the unidirectional state space processing branch with the image patch labels processed by the local space feature processing branch by adding them element by element. The fused image patch labels and the learnable classification labels updated by the unidirectional state space processing branch are then combined to form an output label sequence, which is then input into the next feature extraction unit after channel feature transformation to complete the layer-by-layer feature extraction. Based on the visual task type, image patch labels and / or learnable classification labels are extracted from the label sequence output by the feature extraction unit.
2. The image feature extraction method based on unidirectional visual state space according to claim 1, characterized in that, The feature dimensions of the learnable classification labels are consistent with the dimensions of the image patch labels.
3. The image feature extraction method based on unidirectional visual state space according to claim 1, characterized in that, In the defined feature extraction unit, the unidirectional state space processing branch includes a selective flipping part and a unidirectional state space modeling part; Among the remaining feature extraction units, the unidirectional state space processing branch includes the unidirectional state space modeling part; The selective flipping section performs selective flipping on the image patch markers. Specifically, it includes flipping the image patch markers before inputting them into the unidirectional state space modeling section, and then flipping the image patch markers processed by the unidirectional state space modeling section again to restore their original arrangement order. The one-way state space modeling part performs one-way state space processing on image patch labels and learnable classification labels.
4. The image feature extraction method based on unidirectional visual state space according to claim 3, characterized in that, The unidirectional state space modeling part includes an input feature mapping layer, a one-dimensional sequence convolutional layer, a state space modeling layer, a gating processing layer, a normalization layer, and an output feature mapping layer. Each image patch label and each learnable classification label in the label sequence to be processed are input into the input feature mapping layer as a whole. The input feature mapping layer processes each label in the sequence according to the same mapping method and divides the mapping result into content features and gating features along the feature dimension, so that each image patch label and each learnable classification label generates a set of content features and a set of gating features. The content features are processed by a one-dimensional sequence convolution layer and non-linear activation, and then input into the state space modeling layer. The state space modeling layer models the context information according to the arrangement direction of the label sequence to be processed. The gated features are nonlinearly activated by the gated processing layer and then multiplied element-wise with the features output by the state space modeling layer. The multiplication result is then normalized by the normalization layer and output feature mapping by the output feature mapping layer to obtain the updated label sequence.
5. The image feature extraction method based on unidirectional visual state space according to claim 3, characterized in that, The selective flipping section is set once every other feature extraction unit.
6. The image feature extraction method based on unidirectional visual state space according to claim 1, characterized in that, The local spatial feature processing branch includes a two-dimensional spatial restoration layer, a deep convolutional layer, and a sequence flattening layer. The two-dimensional spatial restoration layer restores the one-dimensional image patch label sequence into a two-dimensional feature arrangement based on the row and column positions of each image patch label in the input image. The deep convolutional layer uses a 3x3 kernel size for deep convolution to perform channel-by-channel local spatial modeling of image patch features at adjacent positions in the two-dimensional features. The sequence flattening layer flattens the two-dimensional features that have undergone local spatial modeling back into a one-dimensional image patch label sequence according to the original arrangement order of the image patch labels.
7. The image feature extraction method based on unidirectional visual state space according to claim 1, characterized in that, For image classification tasks, a preset number of learnable classification labels are selected from the label sequence output by the last feature extraction unit. The feature vectors corresponding to each selected learnable classification label are then concatenated along the feature dimension according to the original arrangement order of each learnable classification label in the output label sequence to form global image features.
8. The image feature extraction method based on unidirectional visual state space according to claim 1, characterized in that, Select the label sequence output by the feature extraction unit with a set order, remove the learnable classification labels from each output label sequence, retain the image patch labels, and restore the image patch labels of each layer into two-dimensional feature maps according to the row and column positions of the image patch labels in the input image.
9. The image feature extraction method based on unidirectional visual state space according to claim 1, characterized in that, For object detection or instance segmentation tasks, the output label sequence is obtained from the last feature extraction unit, the learnable classification labels are removed, and the remaining image patch labels are restored into two-dimensional feature maps according to their corresponding spatial locations.
