A strip target recognition method, system, computer device and storage medium

CN118968306BActive Publication Date: 2026-09-18HUNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411093737.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2026-09-18
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

但利用Transformer架构从遥感图像中识别线性道路时,面临以下挑战:(1)、传统的Transformer采用方形图像块,这适用于大多数自然物体,但不适用于通常呈现细长形状的道路,使用方形图像块难以提取道路的大规模线性特征,并会引入更高的计算复杂度和内存占用;(2)、为了降低视觉Transformer的计算成本,近期的研究工作尝试将自注意力限制在较小的局部区域,这妨碍了模型缓解影响道路可见性的局部遮挡问题的能力

Benefits of technology

[0029] The aforementioned method, system, computer device, and storage medium for recognizing strip-shaped targets first acquire image data of the strip-shaped target to be detected. Then, a strip-shaped target recognition model is preset, comprising an encoder module, a cross-spatial Transformer module, and a decoder module connected sequentially. Next, the strip-shaped target recognition model is trained to obtain a trained strip-shaped target recognition model. Finally, the image data of the strip-shaped target to be detected is input into the trained strip-shaped target recognition model. In the trained model, the encoder module receives the image data of the strip-shaped target and extracts features, outputting image features; the cross-spatial Transformer module receives and processes the image features, outputting cross-spatial perception features; and the decoder module receives and processes the cross-spatial perception features, outputting the recognition result of the strip-shaped target to be detected. This method improves the learning process of square image blocks and local region constraints in the Transformer structure. By utilizing cross-spatial parallel Transformer blocks, it can not only acquire long-range dependencies of different dimensions and across pixels in the strip-shaped target region, but also effectively reduce the memory and computational complexity of the self-attention module, achieving efficient and high-precision strip-shaped target recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968306B_ABST
    Figure CN118968306B_ABST
Patent Text Reader

Abstract

The application discloses a strip target recognition method and system, computer equipment and a storage medium. A strip target recognition model is preset, the model comprises an encoder module, a cross-space Transformer module and a decoder module connected in sequence, the strip target recognition model is trained by using a training set, a loss is calculated by using a preset loss function, a trained strip target recognition model is obtained, image data of a strip target to be detected is input into the trained strip target recognition model, the encoder module in the trained strip target recognition model receives the image data of the strip target and extracts features, outputs image features, the cross-space Transformer module receives the image features and processes the image features, outputs cross-space perception features, and the decoder module receives the cross-space perception features and processes the cross-space perception features, and outputs a recognition result of the strip target to be detected. The method can efficiently and accurately realize strip target recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, system, computer device, and storage medium for recognizing strip-shaped targets. Background Technology

[0002] The identification of strip-shaped targets (such as roads in remote sensing images) plays a crucial role in vehicle navigation, urban planning, and autonomous driving. Existing road mapping methods, such as mobile GPS trajectory aggregation or manual road labeling, cannot handle large-scale areas. Furthermore, these methods are time-consuming and cannot update dynamic environments in a timely manner, such as road networks changing due to natural disasters. Remote sensing imagery offers wide coverage and provides up-to-date geospatial information, making it a feasible solution for the automatic updating of road networks.

[0003] Traditional road recognition research utilizes low-level features and defines heuristic rules to segment roads from remote sensing images. These methods typically require manual inspection and are not suitable for large-scale areas. In recent years, CNNs (convolutional neural networks) with encoder-decoder structures have demonstrated high performance in image semantic segmentation. Some road extraction studies have also applied CNNs; however, due to the difficulties inherent in remote sensing images, these methods often generate fragmented road segments. Road connectivity is a core property, and ensuring road connectivity is a prerequisite and key condition for other downstream tasks. To improve the connectivity of extracted roads, some methods first generate semantic segmentation results and then employ post-processing steps to fill in missing roads. These methods typically use shortest path algorithms as post-processing, but these post-processing algorithms are usually designed for specific road images, have poor generalization ability, and are time-consuming. In addition, some studies have improved road connectivity by constructing iterative graph processes or iteratively optimizing connectivity, or by combining road features of different shapes (e.g., points, edges, and regions) into a framework. However, these methods typically require processing more diverse data and more complex training steps.

[0004] Due to the inherent locality of convolutional operations, CNN-based methods lack the ability to model explicit long-range relationships. The Transformer, designed for sequence-to-sequence prediction machine translation tasks, not only excels at learning long-range dependencies between input labels but also demonstrates superior ability to model global context. It has been explored and achieved state-of-the-art performance in many computer vision tasks. However, when using the Transformer architecture to identify linear roads from remote sensing images, the following challenges are faced: (1) Traditional Transformers use square image patches, which are suitable for most natural objects but not for roads that are usually elongated. Using square image patches makes it difficult to extract large-scale linear features of roads and introduces higher computational complexity and memory consumption; (2) In order to reduce the computational cost of visual Transformers, recent research has attempted to restrict self-attention to smaller local regions, which hinders the model's ability to mitigate local occlusion problems that affect road visibility. Summary of the Invention

[0005] To address the aforementioned problems, this invention proposes a method, system, computer device, and storage medium for recognizing strip-shaped targets. By improving the learning process of square image blocks and local region constraints in the Transformer structure, it is not only able to obtain long-range dependencies of different dimensions of road regions, but also effectively reduces the memory and computational complexity of the self-attention module.

[0006] This invention provides a method for identifying strip-shaped targets, comprising the following steps:

[0007] S1. Acquire image data of the bar-shaped target to be detected;

[0008] S2. Preset strip target recognition model, which includes an encoder module, a cross-space Transformer module and a decoder module connected in sequence;

[0009] S3. The strip target recognition model is trained using the training set, and the loss is calculated using a preset loss function to obtain the trained strip target recognition model.

[0010] S4. Input the image data of the strip target to be detected into the trained strip target recognition model. The encoder module in the trained strip target recognition model receives the image data of the strip target and performs feature extraction, outputting image features. The cross-space Transformer module receives and processes the image features, outputting cross-space perception features. The decoder module receives and processes the cross-space perception features, outputting the recognition result of the strip target to be detected.

[0011] Preferably, the encoder module in S2 includes several layers of encoded blocks connected in sequence, the decoder module includes the same number of decoder blocks connected in sequence as the several layers of encoded blocks, and the cross-space Transformer module includes several cross-space Transformer blocks. The several layers of encoded blocks and the several layers of decoder blocks, except for the top layer, are respectively connected through several cross-space Transformer blocks.

[0012] Preferably, the encoder module in S2 is a deep residual network, which includes several residual blocks connected in sequence. The image data of the strip target is input into the deep residual network for processing, and the several residual blocks connected in sequence extract several image features from the image data of the strip target in sequence.

[0013] Preferably, each cross-space Transformer block in the cross-space Transformer module of S2 includes a bar attention module and a cross-pixel attention module connected in parallel. The bar attention module and the cross-pixel attention module respectively receive and process the image features output by the corresponding connected coding block, and output bar attention features and cross-pixel attention features respectively. The bar attention features and cross-pixel attention features are concatenated, and the concatenated features are used as the cross-space perception features output by the corresponding cross-space Transformer block.

[0014] Preferably, the bar attention module includes a first normalization layer, a bar attention layer, a second normalization layer, and a first multilayer perceptron connected in sequence. The bar attention module receives and processes the image features output by the corresponding connected coding block, and outputs bar attention features. The specific process is as follows:

[0015] S21. The bar attention module receives the image features output by the corresponding connected coding block and splits them into horizontal bar feature blocks and vertical bar feature blocks;

[0016] S22. Preprocess the horizontal and vertical strip feature blocks to obtain the first linear feature after embedding at a specific location through fusion;

[0017] S23. The first normalization layer receives and processes the first fused linear features embedded at a specific position to obtain the first normalized linear features. The bar attention layer receives and processes the first normalized linear features to obtain the bar attention perception linear features. The second normalization layer receives and processes the bar attention perception linear features to output the second normalized linear features.

[0018] S24. Input the second normalized linear features into the first multilayer perceptron for processing, and output bar-shaped attention features.

[0019] Preferably, the cross-pixel attention module includes a third normalization layer, a cross-pixel attention layer, a fourth normalization layer, and a second multilayer perceptron connected in sequence. The cross-pixel attention module receives and processes the image features output by the corresponding connected coding block, and outputs cross-pixel attention features. The specific process is as follows:

[0020] S25. The cross-pixel attention module receives the image features output by the corresponding coded block and samples them at a preset interval. The sampled pixel embedding features are spliced ​​and preprocessed to obtain the second linear feature after embedding at a specific location.

[0021] S26. The third normalization layer receives and processes the linear features embedded at specific locations after the second fusion to obtain the third normalized linear features. The cross-pixel attention module receives and processes the third normalized linear features to obtain the cross-pixel attention-aware linear features. The fourth normalization layer receives and processes the cross-pixel attention-aware linear features to output the fourth normalized linear features.

[0022] S27. Input the fourth normalized linear feature into the second multilayer perceptron for processing to obtain cross-pixel attention features.

[0023] Preferably, in S2, the bottom-level decoding block in the decoder module receives and processes the cross-space perception features output by the cross-space Transformer block connected to it to obtain the bottom-level decoding features. Other non-bottom-level decoding blocks in the decoder module receive and process the cross-space perception features output by the cross-space Transformer block connected to them and the decoding features output by the previous adjacent layer decoding block to obtain the decoding features corresponding to the current layer decoding block. The top-level decoding block in the decoder module receives the decoding features output by the previous layer decoding block adjacent to it. After convolution processing, the decoding features corresponding to the top-level decoding block are output, and the decoding features corresponding to the top-level decoding block are used as the recognition result of the bar target.

[0024] Another aspect of the present invention provides a strip-shaped target recognition system, which uses the aforementioned strip-shaped target recognition method to identify strip-shaped targets. The recognition system includes an image data acquisition module, a strip-shaped target recognition model, and a computer system. The image data acquisition module is connected to the computer system, and the strip-shaped target recognition model is set in the computer system, wherein:

[0025] The image data acquisition module is used to acquire image data of the bar-shaped target to be detected and send the image data to the computer system;

[0026] The computer system receives image data and processes it through a bar-shaped target recognition model set on it to obtain the recognition result of the bar-shaped targets in the image.

[0027] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for identifying strip-shaped targets.

[0028] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method for identifying strip-shaped targets.

[0029] The aforementioned method, system, computer device, and storage medium for recognizing strip-shaped targets first acquire image data of the strip-shaped target to be detected. Then, a strip-shaped target recognition model is preset, comprising an encoder module, a cross-spatial Transformer module, and a decoder module connected sequentially. Next, the strip-shaped target recognition model is trained to obtain a trained strip-shaped target recognition model. Finally, the image data of the strip-shaped target to be detected is input into the trained strip-shaped target recognition model. In the trained model, the encoder module receives the image data of the strip-shaped target and extracts features, outputting image features; the cross-spatial Transformer module receives and processes the image features, outputting cross-spatial perception features; and the decoder module receives and processes the cross-spatial perception features, outputting the recognition result of the strip-shaped target to be detected. This method improves the learning process of square image blocks and local region constraints in the Transformer structure. By utilizing cross-spatial parallel Transformer blocks, it can not only acquire long-range dependencies of different dimensions and across pixels in the strip-shaped target region, but also effectively reduce the memory and computational complexity of the self-attention module, achieving efficient and high-precision strip-shaped target recognition. Attached Figure Description

[0030] Figure 1 This is a flowchart of a method for identifying strip-shaped targets according to an embodiment of the present invention;

[0031] Figure 2 This is a schematic diagram of the structure of a strip-shaped target recognition model in one embodiment of the present invention;

[0032] Figure 3 This is a schematic diagram of the working process of the bar-shaped attention module in one embodiment of the present invention;

[0033] Figure 4 This is a schematic diagram of the working process of the cross-pixel attention module in one embodiment of the present invention;

[0034] Figure 5 This is a schematic block diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0035] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.

[0036] In one embodiment, see Figure 1 A method for identifying strip-shaped targets, the method comprising:

[0037] S1. Acquire the image data of the strip-shaped target to be detected. This image data can be remote sensing image data of the strip-shaped target.

[0038] S2. Preset strip target recognition model, which includes an encoder module, a cross-space Transformer module and a decoder module connected in sequence.

[0039] Furthermore, the encoder module in S2 includes several layers of encoded blocks connected in sequence, the decoder module includes the same number of decoder blocks connected in sequence as the several layers of encoded blocks, and the cross-space Transformer module includes several cross-space Transformer blocks. The several layers of encoded blocks and the several layers of decoder blocks, except for the top layer, are respectively connected through several cross-space Transformer blocks.

[0040] See Figure 2 The encoder module includes five layers of sequentially connected encoding blocks, from top to bottom: encoding block 1, encoding block 2, encoding block 3, encoding block 4, and encoding block 5. The decoder module includes five layers of sequentially connected decoding blocks, from top to bottom: decoding block 1, decoding block 2, decoding block 3, decoding block 4, and decoding block 5. The cross-space Transformer module includes four cross-space Transformer blocks. Except for the top-level encoding block (corresponding to encoding block 1) and the top-level decoding block (corresponding to decoding block 1), the other layers of decoding blocks are connected to the corresponding layers of decoding blocks through the cross-space Transformer blocks.

[0041] Furthermore, the encoder module in S2 is specifically a deep residual network, which includes several residual blocks connected in sequence. The image data of the strip target is input into the deep residual network for processing, and the several residual blocks connected in sequence extract several image features from the image data of the strip target in sequence.

[0042] For example, a deep residual network ResNet-50 or ResNet-101 can be used as an encoder module. Taking ResNet-101 as an example, the deep residual network ResNet-101 includes 5 sequentially connected residual blocks. The 5 residual blocks are used as corresponding encoding blocks. The image data of the bar target is input into the deep residual network ResNet-101 for processing. The 5 residual blocks use pre-trained weights to extract 5 image features from the image data of the bar target in sequence, including: first image feature F_1, second image feature F_2, third image feature F_3, fourth image feature F_4, and fifth image feature F_5.

[0043] Furthermore, each cross-space Transformer block in the cross-space Transformer module of S2 includes a bar attention module and a cross-pixel attention module connected in parallel. The bar attention module and the cross-pixel attention module receive and process the image features output by the corresponding connected coding block, and output bar attention features and cross-pixel attention features respectively. The bar attention features and cross-pixel attention features are concatenated, and the concatenated features are used as the cross-space perception features output by the corresponding cross-space Transformer block.

[0044] Specifically, the Transformer divides the input image into several fixed-size, non-overlapping image patches, also known as patches. Each patch is flattened into a one-dimensional vector and embedded into a fixed-dimensional feature representation through a linear projection layer. Since the Transformer itself lacks positional awareness, positional encoding of the image patch embeddings is required to enable the model to understand the spatial location of the image patches within the original image. The embedded image patch sequence is then fed into multiple stacked Transformer encoder layers, each consisting of a multi-head self-attention mechanism and a feedforward neural network. The self-attention mechanism allows the model to establish global associations between different image patches, thereby capturing long-range dependencies in the image. After processing by multiple Transformer encoder layers, the feature representations of the image patches are integrated for downstream tasks such as object recognition.

[0045] The cross-space Transformer block contains two parallel branches, namely a strip attention module (such as...). Figure 3 (as shown) and cross-pixel attention modules (such as Figure 4As shown, the former is used to learn large-scale linear contextual information of the strip target region, while the latter is used to construct long-distance dependencies between non-adjacent pixels. A cross-spatial parallel Transformer network model is designed to enhance the recognition ability of complete strip targets. A strip attention module and a cross-pixel attention module are proposed to address the occlusion problem of other objects on the strip targets. Simultaneously, large-scale linear contextual information of the strip targets is acquired, improving the recognition ability. The learning process of square image patches and local region constraints in the Transformer structure is improved, which not only acquires long-range dependencies of different dimensions in the road region but also effectively reduces the memory and computational complexity of the self-attention module.

[0046] In one embodiment, see Figure 3 The bar attention module includes a first normalization layer, a bar attention layer, a second normalization layer, and a first multilayer perceptron connected in sequence. The bar attention module receives and processes the image features output by the corresponding connected coding block, and outputs bar attention features. The specific process is as follows:

[0047] S21. The bar attention module receives the image features output by the corresponding connected coding block and splits them into horizontal bar feature blocks and vertical bar feature blocks;

[0048] S22. Preprocess the horizontal and vertical strip feature blocks to obtain the first linear feature after embedding at a specific location through fusion;

[0049] S23. The first normalization layer receives and processes the first fused linear features embedded at a specific position to obtain the first normalized linear features. The bar attention layer receives and processes the first normalized linear features to obtain the bar attention perception linear features. The second normalization layer receives and processes the bar attention perception linear features to output the second normalized linear features.

[0050] S24. Input the second normalized linear features into the first multilayer perceptron for processing, and output bar-shaped attention features.

[0051] Specifically, the image features output by each non-top-level coding block are split into horizontal bar feature blocks and vertical bar feature blocks. The horizontal and vertical bar feature blocks are processed by feature transformation and linear layer to obtain the first fused linear features embedded at a specific location. The first fused linear features embedded at a specific location are then processed sequentially by the first normalization layer, the bar attention layer, the second normalization layer, and the first multilayer perceptron to obtain the bar attention features.

[0052] In one embodiment, see Figure 4The cross-pixel attention module includes a third normalization layer, a cross-pixel attention layer, a fourth normalization layer, and a second multilayer perceptron connected in sequence. The cross-pixel attention module receives and processes the image features output by the corresponding connected coding block, and outputs cross-pixel attention features. The specific process is as follows:

[0053] S25. The cross-pixel attention module receives the image features output by the corresponding coded block and samples them at a preset interval. The sampled pixel embedding features are spliced ​​and preprocessed to obtain the second linear feature after embedding at a specific location.

[0054] S26. The third normalization layer receives and processes the linear features embedded at specific locations after the second fusion to obtain the third normalized linear features. The cross-pixel attention module receives and processes the third normalized linear features to obtain the cross-pixel attention-aware linear features. The fourth normalization layer receives and processes the cross-pixel attention-aware linear features to output the fourth normalized linear features.

[0055] S27. Input the fourth normalized linear feature into the second multilayer perceptron for processing to obtain cross-pixel attention features.

[0056] Specifically, image features output from each non-top-level coding block are sampled at preset intervals. The sampled pixel embedding features are concatenated to obtain a feature embedding block. The feature embedding block undergoes feature transformation and linear layer processing to obtain a second fused linear feature embedded at a specific location. The second fused linear feature embedded at a specific location is then processed sequentially through a third normalization layer, a cross-pixel attention layer, a fourth normalization layer, and a second multilayer perceptron to obtain cross-pixel attention features.

[0057] The image features learned by the corresponding encoder modules are transformed in parallel using the bar attention module and the cross-pixel attention module within each cross-spatial Transformer block. The features output by the bar attention module and the cross-pixel attention module are then fused pairwise to obtain the cross-spatial perceptual features. See also... Figure 2 The cross-space perception features output by cross-space Transformer blocks 1 to 4 are the first cross-space perception feature C_1, the second cross-space perception feature C_2, the third cross-space perception feature C_3, and the fourth cross-space perception feature C_4, respectively.

[0058] In one embodiment, the bottom-level decoding block in the decoder module of S2 receives and processes the cross-space perception features output by the cross-space Transformer block connected to it to obtain the bottom-level decoding features. Other non-bottom-level decoding blocks in the decoder module receive and process the cross-space perception features output by the cross-space Transformer block connected to them and the decoding features output by the previous adjacent layer decoding block to obtain the decoding features corresponding to the current layer decoding block. The top-level decoding block in the decoder module receives the decoding features output by the previous layer decoding block adjacent to it. After convolution processing, the decoding features corresponding to the top-level decoding block are output, and the decoding features corresponding to the top-level decoding block are used as the recognition result of the bar target.

[0059] Specifically, see Figure 2 The lowest level decoding block (corresponding to) Figure 2 Decoding block 5) receives the fourth cross-space Transformer block (corresponding to) connected to it. Figure 2 The fourth cross-space perceptual feature C_4 output by the cross-space Transformer block 4) is processed to obtain the lowest-level decoded feature, which is the fifth decoded feature; the fourth-layer decoder block (corresponding to Figure 2 Decoding block 4) receives the third cross-space Transformer block (corresponding to) connected to it. Figure 2 The third cross-space sensing feature C_3 output by the cross-space Transformer block 3 in the middle also receives and processes the fifth decoding feature output by the decoding block 5, and outputs the fourth decoding feature; the top-level decoding block (corresponding to Figure 2 Decoding block 1) receives the second decoding feature output by decoding block 2 and processes it to obtain the first decoding feature, and uses the first decoding feature as the recognition result of the bar target.

[0060] S3. The strip target recognition model is trained using the training set, and the loss is calculated using a preset loss function to obtain the trained strip target recognition model.

[0061] During the training phase, the strip target recognition model is trained using a pre-set dataset, which includes training images and corresponding ground truth images. The training images are input into the strip target recognition model for processing, and the strip target recognition results of the training images are predicted. A pre-set loss function is used to calculate the loss between the strip target recognition results of the training images and the ground truth images. The gradient is then backpropagated and the parameters of the strip target recognition model are updated to obtain the trained strip target recognition model.

[0062] S4. Input the image data of the strip target to be detected into the trained strip target recognition model. The encoder module in the trained strip target recognition model receives the image data of the strip target and performs feature extraction, outputting image features. The cross-space Transformer module receives and processes the image features, outputting cross-space perception features. The decoder module receives and processes the cross-space perception features, outputting the recognition result of the strip target to be detected.

[0063] In one embodiment, a strip-shaped target recognition system uses the aforementioned strip-shaped target recognition method to identify strip-shaped targets. The recognition system includes an image data acquisition module, a strip-shaped target recognition model, and a computer system. The image data acquisition module is connected to the computer system, and the strip-shaped target recognition model is set within the computer system.

[0064] The image data acquisition module is used to acquire image data of the bar-shaped target to be detected and send the image data to the computer system;

[0065] The computer system receives image data and processes it through a bar-shaped target recognition model set on it to obtain the recognition result of the bar-shaped targets in the image.

[0066] For specific limitations on a strip-shaped target recognition system, please refer to the limitations on a strip-shaped target recognition method mentioned above, which will not be repeated here.

[0067] In one embodiment, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-described method for identifying strip-shaped targets. The computer device can be any computer device capable of implementing a method for identifying strip-shaped targets, such as a mobile phone, tablet, or mobile computer.

[0068] In one embodiment, a computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the above-described method for identifying strip-shaped targets.

[0069] Specifically, see Figure 5 , Figure 5 This is a schematic block diagram of a computer device according to an embodiment of the present invention.

[0070] The computer device 3 can be a smartphone, tablet computer, laptop computer, desktop computer, etc., that executes programs. In this embodiment, the computer device 3 includes, but is not limited to, a memory 31, a processor 32, and a computer program 33 stored in the memory 31 and executable on the processor 32, such as the program corresponding to the aforementioned method for identifying strip-shaped targets. Those skilled in the art will understand that the schematic diagram is merely an example of the computer device 3 and does not constitute a limitation on the computer device 3.

[0071] The memory 31 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. The memory 31 can be an internal storage unit of the electronic device 1, such as the portable hard drive of the computer device 3, or an external storage device of the computer device 3, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 31 can include both internal and external storage units of the computer device 3. The memory 31 can be used not only to store application software and various types of data installed on the computer device 3, such as the program code corresponding to the aforementioned strip target identification method, but also to temporarily store data that has been output or will be output.

[0072] The processor 32 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 32 executes the operating system of the computer device 3 and various installed application programs. In this embodiment, the processor 32 executes a computer program 33 stored in the memory 31 to implement a strip-shaped target identification method disclosed in this embodiment of the invention.

[0073] Since the aforementioned computer equipment and computer-readable storage medium both include the aforementioned method for identifying strip-shaped targets, they also possess the beneficial effects of this identification method, which will not be elaborated further here.

[0074] The aforementioned method, system, computer device, and storage medium for recognizing strip-shaped targets first acquire image data of the strip-shaped target to be detected. Then, a strip-shaped target recognition model is preset, comprising an encoder module, a cross-spatial Transformer module, and a decoder module connected sequentially. Next, the strip-shaped target recognition model is trained to obtain a trained strip-shaped target recognition model. Finally, the image data of the strip-shaped target to be detected is input into the trained strip-shaped target recognition model. In the trained model, the encoder module receives the image data of the strip-shaped target and extracts features, outputting image features; the cross-spatial Transformer module receives and processes the image features, outputting cross-spatial perception features; and the decoder module receives and processes the cross-spatial perception features, outputting the recognition result of the strip-shaped target to be detected. This method improves the learning process of square image blocks and local region constraints in the Transformer structure. By utilizing cross-spatial parallel Transformer blocks, it can not only acquire long-range dependencies across pixels and dimensions of the strip-shaped target region but also effectively reduce the memory and computational complexity of the self-attention module, achieving efficient and high-precision strip-shaped target recognition.

[0075] The foregoing has provided a detailed description of the method, system, computer device, and storage medium for identifying strip-shaped targets provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention, and the descriptions of the embodiments above are merely for the purpose of helping to understand the core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from the principles of this invention, and these improvements and modifications also fall within the protection scope of the claims of this invention.

Claims

1. A method for identifying strip-shaped targets, characterized in that, The method includes the following steps: S1. Acquire image data of the bar-shaped target to be detected; S2. Preset strip target recognition model, which includes an encoder module, a cross-space Transformer module and a decoder module connected in sequence; S3. The strip target recognition model is trained using the training set, and the loss is calculated using a preset loss function to obtain the trained strip target recognition model. S4. Input the image data of the strip target to be detected into the trained strip target recognition model. The encoder module in the trained strip target recognition model receives the image data of the strip target and extracts features, outputs image features, the cross-space Transformer module receives and processes the image features, outputs cross-space perception features, and the decoder module receives and processes the cross-space perception features, outputs the recognition result of the strip target to be detected. In S2, each cross-space Transformer block in the cross-space Transformer module includes a bar attention module and a cross-pixel attention module connected in parallel. The bar attention module and the cross-pixel attention module receive and process the image features output by the corresponding connected coding block, and output bar attention features and cross-pixel attention features respectively. The bar attention features and cross-pixel attention features are concatenated, and the concatenated features are used as the cross-space perception features output by the corresponding cross-space Transformer block. The bar attention module comprises a first normalization layer, a bar attention layer, a second normalization layer, and a first multilayer perceptron connected in sequence. The bar attention module receives and processes the image features output by the corresponding connected coding block, and outputs bar attention features. The specific process is as follows: S21. The bar attention module receives the image features output by the corresponding connected coding block and splits them into horizontal bar feature blocks and vertical bar feature blocks; S22. Preprocess the horizontal and vertical strip feature blocks to obtain the first linear feature after embedding at a specific location through fusion; S23. The first normalization layer receives and processes the first fused linear features embedded at a specific position to obtain the first normalized linear features. The bar attention layer receives and processes the first normalized linear features to obtain the bar attention perception linear features. The second normalization layer receives and processes the bar attention perception linear features to output the second normalized linear features. S24. Input the second normalized linear feature into the first multilayer perceptron for processing, and output the bar attention feature; The cross-pixel attention module comprises a third normalization layer, a cross-pixel attention layer, a fourth normalization layer, and a second multilayer perceptron, connected sequentially. The cross-pixel attention module receives and processes the image features output by its corresponding connected coding block, outputting cross-pixel attention features. The specific process is as follows: S25. The cross-pixel attention module receives the image features output by the corresponding connected coding block and samples them at a preset interval. The sampled pixel embedding features are spliced ​​and preprocessed to obtain the second fused linear features after embedding at a specific position. S26. The third normalization layer receives and processes the linear features embedded at specific locations after the second fusion to obtain the third normalized linear features. The cross-pixel attention module receives and processes the third normalized linear features to obtain the cross-pixel attention-aware linear features. The fourth normalization layer receives and processes the cross-pixel attention-aware linear features to output the fourth normalized linear features. S27. Input the fourth normalized linear feature into the second multilayer perceptron for processing to obtain cross-pixel attention features.

2. The method for identifying strip-shaped targets as described in claim 1, characterized in that, The encoder module in S2 includes several layers of encoded blocks connected in sequence. The decoder module includes the same number of decoder blocks connected in sequence as the layers of encoded blocks. The cross-space Transformer module includes several cross-space Transformer blocks. The layers of encoded blocks and the layers of decoder blocks, except for the top layer, are respectively connected through several cross-space Transformer blocks.

3. The method for identifying strip-shaped targets as described in claim 2, characterized in that, The encoder module in S2 is specifically a deep residual network, which consists of several sequentially connected residual blocks. The image data of the strip target is input into the deep residual network for processing, and the sequentially connected residual blocks extract several image features from the image data of the strip target.

4. The method for identifying strip-shaped targets as described in claim 2, characterized in that, In S2, the lowest-level decoding block in the decoder module receives and processes the cross-space perception features output by its corresponding connected cross-space Transformer block to obtain the lowest-level decoding features. Other non-lowest-level decoding blocks in the decoder module receive and process the cross-space perception features output by their corresponding connected cross-space Transformer blocks and the decoding features output by the previous adjacent layer decoding block to obtain the decoding features corresponding to the current layer decoding block. The top-level decoding block in the decoder module receives the decoding features output by its adjacent previous layer decoding block, and after convolution processing, outputs the decoding features corresponding to the top-level decoding block. The decoding features corresponding to the top-level decoding block are used as the recognition result of the bar target.

5. A strip-shaped target identification system, comprising identifying strip-shaped targets using the strip-shaped target identification method as described in any one of claims 1 to 4, characterized in that, The recognition system includes an image data acquisition module, a strip-shaped target recognition model, and a computer system. The image data acquisition module is connected to the computer system, and the strip-shaped target recognition model is set in the computer system. The image data acquisition module is used to acquire image data of the bar-shaped target to be detected and send the image data to the computer system; The computer system receives image data and processes it through a bar-shaped target recognition model set on it to obtain the recognition result of the bar-shaped targets in the image.

6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the strip target recognition method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps in the strip target recognition method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Moving object classification method based on appearance keeping module and three-dimensional convolution

    CN113111724A

  • Ultrasonic or CT medical image three-dimensional reconstruction method based on self-attention Transform

    CN113689542A