Target tracking method and system based on compact axial attention and detail enhancement
By introducing compact axial attention and detail enhancement modules into target tracking, the problem of high computing burden on Transformer-based target trackers is solved, and efficient and stable target tracking is achieved.
Patent Information
- Application Number
- CN202510240847.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-03-03
AI Technical Summary
The target tracker based on Transformer has a huge computing burden due to the self-attention calculation of the similarity between each pixel, which affects the real-time nature of the tracker.
A target tracking method based on compact axial attention and detail enhancement is proposed. Compact axial attention is constructed through a multi-head attention mechanism, and detailed enhancement module is constructed in combination with the channel attention mechanism, and feature extraction network and feature fusion module are constructed to reduce the computational amount and improve tracking performance.
While maintaining the global semantics of features, it significantly reduces the computational amount, improves the stability and efficiency of target tracking, and can achieve efficient target tracking in complex environments.
Smart Images

Figure CN119741578B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and image processing, and in particular to a target tracking method and system based on compact axial attention and detail enhancement. Background Art
[0002] Object tracking is one of the main research directions in the field of computer vision. After the initial state of the target in a given video sequence, the position of the target is calibrated using a bounding box in subsequent video frames to achieve continuous positioning and state estimation of the target. Currently, object tracking is widely used in public security, autonomous driving, intelligent robots, human-computer intelligent interaction, medical diagnosis and other fields.
[0003] In real-world target tracking, the target is subject to various challenging factors, mainly because the target is a non-specific object and the target tracker cannot pre-train or model the target in advance. Moreover, during the tracking process, the target will undergo various changes and be disturbed by the surrounding environment, such as target disappearance, appearance changes, background interference, rapid movement, etc. These factors pose great challenges to the tracking algorithm.
[0004] In recent years, Transformer-based trackers have achieved encouraging tracking performance. Transformer can be used to model the relationship between various basic visual elements, including pixel-pixel, object-pixel, and object-object. Convolution is a local operation, and a convolution layer usually only models the relationship between adjacent pixels. Transformer is a global operation, and the Transformer layer can model the relationship between all pixels, and the two can complement each other well. Convolution can be regarded as a template matching, using the same template to filter different locations in the image. The attention unit in Transformer is an adaptive filter, and this adaptive computing module has strong modeling capabilities. Compared with CNN, Transformer is more competitive in some visual tasks and shows better performance.
[0005] However, Transformer-based trackers usually bring huge computational burden due to self-attention calculation of the similarity between each pixel, which affects the real-time performance of the tracker. Summary of the invention
[0006] In view of the above situation, the main purpose of the present invention is to propose a target tracking method and system based on compact axial attention and detail enhancement to solve the above technical problems.
[0007] The present invention proposes a target tracking method based on compact axial attention and detail enhancement, the method comprising the following steps:
[0008] Step 1: Construct a compact axial attention based on the multi-head attention mechanism, construct a detail enhancement module based on the channel attention mechanism, construct a feature extraction network based on the compact axial attention and detail enhancement modules, and construct a feature fusion module based on the asymmetric cross attention mechanism. The compact axial attention, detail enhancement module and feature extraction network constitute a target tracking model.
[0009] Step 2: Input the template image and the search area image into the feature extraction network for unified feature learning to obtain an output feature map;
[0010] Based on the output feature map, an optimized feature extraction network is obtained;
[0011] Step 3: Pre-train and adjust the parameters of the optimized feature extraction network in sequence using a large-scale data set to obtain a feature extraction network after parameter adjustment;
[0012] Step 4: Input the template image and the search area image into the feature extraction network after parameter adjustment to extract features and obtain detail fusion features;
[0013] Step 5: Flatten and concatenate the detail fusion features in sequence, and input them into the feature fusion module for feature fusion to obtain fusion features containing global context information;
[0014] Step 6: Input the fused features containing global context information into the prediction head, obtain the target tracking frame, and use the target tracking model to track the target tracking frame to obtain the tracking result.
[0015] The present invention also proposes a target tracking system based on compact axial attention and detail enhancement, the system comprising:
[0016] Building blocks for:
[0017] Compact axial attention is constructed based on the multi-head attention mechanism, detail enhancement module is constructed based on the channel attention mechanism, feature extraction network is constructed based on compact axial attention and detail enhancement modules, feature fusion module is constructed based on asymmetric cross attention mechanism, and compact axial attention, detail enhancement module and feature extraction network constitute the target tracking model;
[0018] Learning modules for:
[0019] Input the template image and the search area image into the feature extraction network for unified feature learning to obtain an output feature map;
[0020] Based on the output feature map, an optimized feature extraction network is obtained;
[0021] Pre-trained modules for:
[0022] Using a large-scale data set, the optimized feature extraction network is pre-trained and parameter-adjusted in turn to obtain a feature extraction network with adjusted parameters;
[0023] Extraction module for:
[0024] Input the template image and the search area image into the feature extraction network after parameter adjustment to extract features and obtain detail fusion features;
[0025] Compute module for:
[0026] The detail fusion features are flattened and concatenated in sequence, and then input into the feature fusion module for feature fusion to obtain fusion features containing global context information;
[0027] Tracking module for:
[0028] The fused features containing global context information are input into the prediction head to obtain the target tracking frame, and the target tracking frame is tracked using the target tracking model to obtain the tracking result.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. This invention adopts a compact axial attention mechanism, which innovatively compresses the feature information in the horizontal and vertical directions onto a single axis. Through this dimensionality reduction method, the amount of computation can be significantly reduced while maintaining the global semantics of the features. This design enables the tracker to effectively capture the global semantic information in the image at a lower computational cost, thereby achieving stable and efficient target tracking in various complex environments;
[0031] 2. The present invention designs a detail enhancement module, which is specifically used to extract and enhance local detail information in feature maps, such as edges and textures; by fusing this detail information with the output of compact axial attention, the tracker can restore and utilize local detail information while maintaining global semantic understanding, thereby significantly improving the accuracy of target tracking.
[0032] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description or learned through embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Flow chart of the steps of the target tracking method based on compact axial attention and detail enhancement proposed in the present invention.
[0034] Figure 2This is a structural diagram of the winning tracking framework of the target tracking method based on compact axial attention and detail enhancement proposed in the present invention.
[0035] Figure 3 Schematic diagram of the target tracking method based on compact axial attention and detail enhancement proposed in this invention.
[0036] Figure 4 Schematic diagram of the overall framework of the target tracking system based on compact axial attention and detail enhancement proposed in the present invention. DETAILED DESCRIPTION
[0037] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout are the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0038] These and other aspects of the embodiments of the present invention will be apparent with reference to the following description and accompanying drawings. In these descriptions and accompanying drawings, some specific implementations of the embodiments of the present invention are specifically disclosed to provide some ways to implement the principles of the embodiments of the present invention, but it should be understood that the scope of the embodiments of the present invention is not limited thereto.
[0039] See also Figure 1 , an embodiment of the present invention proposes a target tracking method based on compact axial attention and detail enhancement, the method comprising the following steps:
[0040] Step 1. Construct a compact axial attention based on the multi-head attention mechanism, construct a detail enhancement module based on the channel attention mechanism, construct a feature extraction network based on the compact axial attention and detail enhancement modules, and construct a feature fusion module based on the asymmetric cross attention mechanism. The compact axial attention, detail enhancement module and feature extraction network constitute a target tracking model.
[0041] Step 2: Input the template image and the search area image into the feature extraction network for unified feature learning to obtain an output feature map;
[0042] Based on the output feature map, an optimized feature extraction network is obtained.
[0043] In step 2, the template image and the search area image are input into the feature extraction network for unified feature learning to obtain an output feature map, which specifically includes the following steps:
[0044] Input the template image and the search area image into the compact axial attention for linear projection processing to obtain a first query vector, a first key vector and a first value vector;
[0045] Performing compression operations in the horizontal direction and the vertical direction on the first query vector, the first key vector, and the first value vector, respectively, to obtain a horizontally compressed first query vector, a horizontally compressed first key vector, and a horizontally compressed first value vector, as well as a vertically compressed first query vector, a vertically compressed first key vector, and a vertically compressed first value vector;
[0046] A compact axial attention mechanism is performed on the horizontally compressed first query vector, the horizontally compressed first key vector, and the horizontally compressed first value vector, as well as the vertically compressed first query vector, the vertically compressed first key vector, and the vertically compressed first value vector to obtain an output feature map.
[0047] In the step of inputting the template image and the search area image into the compact axial attention for linear projection processing to obtain the first query vector, the first key vector and the first value vector, the corresponding process has the following relationship:
[0048] ;
[0049] in, represents the first query vector, represents the first key vector, represents the first value vector, Represents the input template image and search area image, represents the learnable parameter matrix of the first query vector, represents the learnable parameter matrix of the first bond vector, represents the learnable parameter matrix of the first value vector;
[0050] In the step of performing compression operations in the horizontal direction and the vertical direction on the first query vector, the first key vector, and the first value vector, respectively, to obtain the horizontally compressed first query vector, the horizontally compressed first key vector, and the horizontally compressed first value vector, and the vertically compressed first query vector, the vertically compressed first key vector, and the vertically compressed first value vector, the corresponding processes have the following relationship:
[0051] ;
[0052] in, represents the first query vector after horizontal compression, represents the first key vector after horizontal compression, represents the first value vector after horizontal compression, represents the first query vector after vertical compression, represents the first key vector after vertical compression, represents the first value vector after vertical compression, Adaptive learnable masks representing horizontal compression, represents the feature map width, represents the feature map height, Adaptive learnable masks representing vertical compression;
[0053] In the step of performing a compact axial attention mechanism on the horizontally compressed first query vector, the horizontally compressed first key vector, and the horizontally compressed first value vector, as well as the vertically compressed first query vector, the vertically compressed first key vector, and the vertically compressed first value vector to obtain an output feature map, the corresponding relationship between the process is as follows:
[0054] ;
[0055] in, Indicates that the output feature map is at position The characteristic vector of represents the rows of the feature map, represents the columns of feature maps, represents the height of the feature map, represents the matrix transpose, It means that after normalization, represents the first part of the horizontally compressed query vector OK, The key vector representing the horizontal compression is at position The vector transpose of A vector of values representing horizontal compression at position The vector transpose of represents the width of the feature map, represents the vertically compressed query vector A vector of columns, The key vector representing the vertical compression is at position The vector transpose of Indicates the sum of the horizontal direction of the feature map. Indicates summing in the vertical direction.
[0056] It should be noted that It is the result of compact axial attention processing. The output feature map contains a large amount of global semantic information and local detail information, which is used to optimize the feature extraction network.
[0057] Step 3: Use a large-scale data set to pre-train and adjust the parameters of the optimized feature extraction network in sequence to obtain a feature extraction network with adjusted parameters.
[0058] Step 4: Input the template image and the search area image into the feature extraction network after parameter adjustment to extract features and obtain detail fusion features.
[0059] See also Figure 2 and Figure 3 In step 4, the template image and the search area image are input into the feature extraction network after parameter adjustment to extract features and obtain detail fusion features, which specifically includes the following steps:
[0060] Input the template image and the search area image into the compact axial attention for linear projection processing to obtain a second query vector, a second key vector and a second value vector;
[0061] Performing compression operations in the horizontal direction and the vertical direction on the first query vector, the first key vector, and the first value vector, respectively, to obtain a horizontally compressed second query vector, a horizontally compressed second key vector, and a horizontally compressed second value vector, as well as a vertically compressed second query vector, a vertically compressed second key vector, and a vertically compressed second value vector;
[0062] Perform multi-head attention mechanism processing on the horizontally compressed second query vector, the horizontally compressed second key vector and the horizontally compressed second value vector, as well as the vertically compressed second query vector, the vertically compressed second key vector and the vertically compressed second value vector, respectively, to obtain a horizontal attention map and a vertical attention map;
[0063] The horizontal attention map and the vertical attention map are respectively subjected to convolution operation, batch normalization operation and matrix dot product operation in sequence to obtain the horizontally expanded and restored attention map and the vertically expanded and restored attention map respectively;
[0064] Superimpose the attention map after horizontal expansion and the attention map after vertical expansion to obtain the final compact axial attention output;
[0065] Using the detail enhancement module, the second query vector, the second key vector and the second value vector are sequentially concatenated, deeply separable convolutionally and batch normalized to obtain features of local detail aggregation;
[0066] The features of local detail aggregation are activated, convolved, and batch normalized in sequence to generate detail-enhanced features;
[0067] The final compact axial attention output and detail enhanced features are fused to obtain detail fused features.
[0068] In the step of inputting the template image and the search area image into the compact axial attention for linear projection processing to obtain the second query vector, the second key vector and the second value vector, the relationship between the corresponding process is as follows:
[0069] ;
[0070] in, represents the second query vector, represents the second key vector, represents the second value vector, Represents the input template image and search area image, represents the learnable parameter matrix of the second query vector, represents the learnable parameter matrix of the second key vector, represents the learnable parameter matrix of the second value vector;
[0071] In the step of performing horizontal compression operations and vertical compression operations on the first query vector, the first key vector, and the first value vector, respectively, to obtain a horizontally compressed second query vector, a horizontally compressed second key vector, and a horizontally compressed second value vector, and a vertically compressed second query vector, a vertically compressed second key vector, and a vertically compressed second value vector, the corresponding processes have the following relationship:
[0072] ;
[0073] in, represents the second query vector after horizontal compression, represents the second key vector after horizontal compression, represents the second value vector after horizontal compression, represents the second query vector after vertical compression, represents the second key vector after vertical compression, represents the second value vector after vertical compression;
[0074] In the steps of performing multi-head attention mechanism processing on the horizontally compressed second query vector, the horizontally compressed second key vector, and the horizontally compressed second value vector, as well as the vertically compressed second query vector, the vertically compressed second key vector, and the vertically compressed second value vector, respectively, to obtain the horizontal attention map and the vertical attention map, the corresponding process has the following relationship:
[0075] ;
[0076] in, represents the horizontal attention map, represents the attention map in the vertical direction, represents the normalization function, represents the matrix transpose, represents the transpose of the second bond vector in the horizontal direction, Represents the transpose of the second bond vector in the vertical direction.
[0077] In the steps of performing convolution operations, batch normalization operations, and matrix dot product operations on the horizontal attention map and the vertical attention map, respectively, to obtain the attention map after horizontal expansion and the attention map after vertical expansion and recovery, the corresponding process has the following relationship:
[0078] ;
[0079] in, represents the attention map after horizontal expansion recovery, represents the attention map after vertical expansion recovery, It means that after batch normalization, It means that after 1x1 convolution processing, represents the original input features, represents the matrix dot product operation, represents the horizontal multi-head self-attention output, Represents the vertical multi-head self-attention output.
[0080] In the step of using the detail enhancement module to sequentially perform a concatenation operation, a depthwise separable convolution operation, and a batch normalization operation on the second query vector, the second key vector, and the second value vector to obtain features of local detail aggregation, the corresponding process has the following relationship:
[0081] ;
[0082] in, Features that represent the aggregation of local details, Represents a splicing operation, represents a 3x3 depth-wise separable convolution operation, Represents a batch normalization operation.
[0083] In the steps of performing activation operations, convolution operations, and batch normalization operations on the features of local detail aggregation in sequence to generate detail enhanced features, the corresponding process has the following relationship:
[0084] ;
[0085] in, represents the detail enhancement feature, represents a 1x1 convolution operation, Represents the activation function.
[0086] Furthermore, linear projection is performed on the template and search area image features to obtain the query vector, key vector, and value vector required for calculating attention.
[0087] Then, the query vector, key vector and value vector are compressed horizontally and vertically respectively to obtain the horizontally compressed query vector, key vector and value vector, and the vertically compressed query vector, key vector and value vector, so that their features are compacted onto one axis in the horizontal and vertical directions respectively.
[0088] Multi-head attention calculation is performed in the horizontal direction using the horizontally compressed query vector, key vector, value vector and the vertically compressed query vector, key vector, value vector to obtain the corresponding attention map.
[0089] Then an expansion operation is performed to restore the squeezed features to redistribute the global information to each position and obtain the final self-attention output.
[0090] Subsequently, the restored attention maps in the horizontal and vertical directions are superimposed to obtain the final compact axial attention output.
[0091] Since compression operation will lose some local details, a detail enhancement module is designed to compensate for the loss of detail information. The detail enhancement module first concatenates the original query vector, key vector, and value vector in the channel dimension, and then performs The deep separable convolution and batch normalization of the proposed algorithm aggregate local details from the query vector, key vector, and value vector. Then a linear projection with ReLU activation function and batch normalization is used to compress the dimension to be consistent with the original features and generate detail enhanced features. Finally, the detail enhanced features are fused with the output of compact axial attention to obtain the enhanced template and search area features.
[0092] Step 5: Flatten and concatenate the detail fusion features in sequence, and input them into the feature fusion module for feature fusion to obtain fusion features containing information.
[0093] In step 5, the detail fusion features are flattened and concatenated in sequence, and input into the feature fusion module for feature fusion to obtain fusion features containing global context information, which specifically includes the following steps:
[0094] Performing linear projection processing on the detail fusion features in sequence to obtain a third query vector, a third key vector and a third value vector;
[0095] Performing target template representation and search area template representation on the third query vector, the third key vector and the third value vector, respectively, to obtain a third query vector, a third key vector and a third value vector represented by the target template, and a third query vector, a third key vector and a third value vector represented by the search area template, respectively;
[0096] Performing asymmetric cross attention calculation on the third query vector, the third key vector and the third value vector represented by the target template, and the third query vector, the third key vector and the third value vector represented by the search area template, to obtain an attention map of the target template and an attention map of the search area template respectively;
[0097] The attention map of the target template and the attention map of the search area template are concatenated and linearly projected in turn to obtain a fused feature containing global context information.
[0098] In the step of performing asymmetric cross attention calculation on the third query vector, the third key vector and the third value vector represented by the target template, and the third query vector, the third key vector and the third value vector represented by the search area template, respectively obtaining the attention map of the target template and the attention map of the search area template, the relationship between the corresponding processes is as follows:
[0099] ;
[0100] in, represents the mixed key vector obtained by concatenating the target template key vector and the search area key vector. a key vector representing the target template, a key vector representing the search region template, represents the mixed key vector obtained by concatenating the target template value vector and the search area value vector. A vector of values representing the target template, A vector of values representing the search region template, represents the attention map of the target, The query vector representing the target template, represents the matrix transpose of the key vector of the target template, represents the attention map of the search area, The query vector representing the search region template, Represents the transpose of the mixed key vector obtained by concatenating the target template key vector and the search area key vector.
[0101] Please refer to Figure 4 The present invention also proposes a target tracking system based on compact axial attention and detail enhancement, the system comprising:
[0102] Building blocks for:
[0103] Compact axial attention is constructed based on the multi-head attention mechanism, detail enhancement module is constructed based on the channel attention mechanism, feature extraction network is constructed based on compact axial attention and detail enhancement modules, feature fusion module is constructed based on asymmetric cross attention mechanism, and compact axial attention, detail enhancement module and feature extraction network constitute the target tracking model;
[0104] Learning modules for:
[0105] Input the template image and the search area image into the feature extraction network for unified feature learning to obtain an output feature map;
[0106] Based on the output feature map, an optimized feature extraction network is obtained;
[0107] Pre-trained modules for:
[0108] Using a large-scale data set, the optimized feature extraction network is pre-trained and parameter-adjusted in sequence to obtain a feature extraction network with adjusted parameters;
[0109] Extraction module for:
[0110] The template image and the search area image are input into the parameter-adjusted feature extraction network to extract features and obtain detail fusion features;
[0111] Compute module for:
[0112] The detail fusion features are flattened and concatenated in sequence, and then input into the feature fusion module for feature fusion to obtain fusion features containing global context information;
[0113] Tracking module for:
[0114] The fused features containing information are input into the prediction head to obtain the target tracking frame, and the target tracking frame is tracked using the target tracking model to obtain the tracking result.
[0115] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0116] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0117] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A target tracking method based on compact axial attention and detail enhancement, the method comprising the following steps: Step 1: Construct a compact axial attention based on the multi-head attention mechanism, construct a detail enhancement module based on the channel attention mechanism, construct a feature extraction network based on the compact axial attention and detail enhancement modules, and construct a feature fusion module based on the asymmetric cross attention mechanism. The compact axial attention, detail enhancement module and feature extraction network constitute a target tracking model. Step 2: Input the template image and the search area image into the feature extraction network for unified feature learning to obtain an output feature map; Based on the output feature map, an optimized feature extraction network is obtained; Step 3: Pre-train and adjust the parameters of the optimized feature extraction network in sequence using a large-scale data set to obtain a feature extraction network after parameter adjustment; Step 4: Input the template image and the search area image into the feature extraction network after parameter adjustment to extract features and obtain detail fusion features; Step 5: Flatten and concatenate the detail fusion features in sequence, and input them into the feature fusion module for feature fusion to obtain fusion features containing global context information; Step 6: Input the fused features containing global context information into the prediction head, obtain the target tracking frame, and use the target tracking model to track the target tracking frame to obtain the tracking result.
2. The target tracking method based on compact axial attention and detail enhancement according to claim 1, characterized in that: In step 2, the template image and the search area image are input into the feature extraction network for unified feature learning to obtain an output feature map, which specifically includes the following steps: Input the template image and the search area image into the compact axial attention for linear projection processing to obtain a first query vector, a first key vector and a first value vector; Performing compression operations in the horizontal direction and the vertical direction on the first query vector, the first key vector, and the first value vector, respectively, to obtain a horizontally compressed first query vector, a horizontally compressed first key vector, and a horizontally compressed first value vector, as well as a vertically compressed first query vector, a vertically compressed first key vector, and a vertically compressed first value vector; A compact axial attention mechanism is performed on the horizontally compressed first query vector, the horizontally compressed first key vector, and the horizontally compressed first value vector, as well as the vertically compressed first query vector, the vertically compressed first key vector, and the vertically compressed first value vector to obtain an output feature map.
3. The target tracking method based on compact axial attention and detail enhancement according to claim 2, characterized in that: In the step of inputting the template image and the search area image into the compact axial attention for linear projection processing to obtain the first query vector, the first key vector and the first value vector, the corresponding process has the following relationship: ; in, represents the first query vector, represents the first key vector, represents the first value vector, Represents the input template image and search area image, represents the learnable parameter matrix of the first query vector, represents the learnable parameter matrix of the first bond vector, represents the learnable parameter matrix of the first value vector; In the step of performing compression operations in the horizontal direction and the vertical direction on the first query vector, the first key vector, and the first value vector, respectively, to obtain the horizontally compressed first query vector, the horizontally compressed first key vector, and the horizontally compressed first value vector, and the vertically compressed first query vector, the vertically compressed first key vector, and the vertically compressed first value vector, the corresponding processes have the following relationship: ; in, represents the first query vector after horizontal compression, represents the first key vector after horizontal compression, represents the first value vector after horizontal compression, represents the first query vector after vertical compression, represents the first key vector after vertical compression, represents the first value vector after vertical compression, Adaptive learnable masks representing horizontal compression, represents the feature map width, represents the feature map height, Adaptive learnable masks representing vertical compression; In the step of performing a compact axial attention mechanism on the horizontally compressed first query vector, the horizontally compressed first key vector, and the horizontally compressed first value vector, as well as the vertically compressed first query vector, the vertically compressed first key vector, and the vertically compressed first value vector to obtain an output feature map, the corresponding relationship between the process is as follows: ; in, Indicates that the output feature map is at position The characteristic vector of represents the rows of the feature map, represents the columns of feature maps, represents the height of the feature map, represents the matrix transpose, It means that after normalization, represents the horizontally compressed query vector OK, The key vector representing the horizontal compression is at position The vector transpose of A vector of values representing horizontal compression at position The vector transpose of represents the width of the feature map, represents the vertically compressed query vector A vector of columns, The key vector representing the vertical compression is at position The vector transpose of Indicates the sum of the horizontal direction of the feature map. Indicates summing in the vertical direction.
4. The target tracking method based on compact axial attention and detail enhancement according to claim 3, characterized in that: In step 4, the template image and the search area image are input into the feature extraction network after parameter adjustment to extract features and obtain detail fusion features, which specifically includes the following steps: Input the template image and the search area image into the compact axial attention for linear projection processing to obtain a second query vector, a second key vector and a second value vector; Performing compression operations in the horizontal direction and the vertical direction on the first query vector, the first key vector, and the first value vector, respectively, to obtain a horizontally compressed second query vector, a horizontally compressed second key vector, and a horizontally compressed second value vector, as well as a vertically compressed second query vector, a vertically compressed second key vector, and a vertically compressed second value vector; Perform multi-head attention mechanism processing on the horizontally compressed second query vector, the horizontally compressed second key vector and the horizontally compressed second value vector, as well as the vertically compressed second query vector, the vertically compressed second key vector and the vertically compressed second value vector, respectively, to obtain a horizontal attention map and a vertical attention map; The horizontal attention map and the vertical attention map are respectively subjected to convolution operation, batch normalization operation and matrix dot product operation in sequence to obtain the horizontally expanded and restored attention map and the vertically expanded and restored attention map respectively; Superimpose the attention map after horizontal expansion and the attention map after vertical expansion to obtain the final compact axial attention output; Using the detail enhancement module, the second query vector, the second key vector and the second value vector are sequentially concatenated, deeply separable convolutionally and batch normalized to obtain features of local detail aggregation; The features of local detail aggregation are activated, convolved, and batch normalized in sequence to generate detail-enhanced features; The final compact axial attention output and detail enhanced features are fused to obtain detail fused features.
5. The target tracking method based on compact axial attention and detail enhancement according to claim 4, characterized in that: In the step of inputting the template image and the search area image into the compact axial attention for linear projection processing to obtain the second query vector, the second key vector and the second value vector, the relationship between the corresponding process is as follows: ; in, represents the second query vector, represents the second key vector, represents the second value vector, Represents the input template image and search area image, represents the learnable parameter matrix of the second query vector, represents the learnable parameter matrix of the second key vector, represents the learnable parameter matrix of the second value vector; In the step of performing horizontal compression operations and vertical compression operations on the first query vector, the first key vector, and the first value vector, respectively, to obtain a horizontally compressed second query vector, a horizontally compressed second key vector, and a horizontally compressed second value vector, and a vertically compressed second query vector, a vertically compressed second key vector, and a vertically compressed second value vector, the corresponding processes have the following relationship: ; in, represents the second query vector after horizontal compression, represents the second key vector after horizontal compression, represents the second value vector after horizontal compression, represents the second query vector after vertical compression, represents the second key vector after vertical compression, represents the second value vector after vertical compression; In the steps of performing multi-head attention mechanism processing on the horizontally compressed second query vector, the horizontally compressed second key vector, and the horizontally compressed second value vector, as well as the vertically compressed second query vector, the vertically compressed second key vector, and the vertically compressed second value vector, respectively, to obtain the horizontal attention map and the vertical attention map, the corresponding process has the following relationship: ; in, represents the horizontal attention map, represents the attention map in the vertical direction, represents the normalization function, represents the matrix transpose, represents the transpose of the second bond vector in the horizontal direction, Represents the transpose of the second bond vector in the vertical direction.
6. The target tracking method based on compact axial attention and detail enhancement according to claim 5, characterized in that: In the steps of performing convolution operations, batch normalization operations, and matrix dot product operations on the horizontal attention map and the vertical attention map, respectively, to obtain the attention map after horizontal expansion and the attention map after vertical expansion and recovery, the corresponding process has the following relationship: ; in, represents the attention map after horizontal expansion recovery, represents the attention map after vertical expansion recovery, It means that after batch normalization, It means that after 1x1 convolution processing, represents the original input features, represents the matrix dot product operation, represents the horizontal multi-head self-attention output, Represents the vertical multi-head self-attention output.
7. The target tracking method based on compact axial attention and detail enhancement according to claim 6, characterized in that: In the step of using the detail enhancement module to sequentially perform a concatenation operation, a depthwise separable convolution operation, and a batch normalization operation on the second query vector, the second key vector, and the second value vector to obtain features of local detail aggregation, the corresponding process has the following relationship: ; in, Features that represent the aggregation of local details, Represents a splicing operation, represents a 3x3 depth-wise separable convolution operation, Represents a batch normalization operation; In the steps of performing activation operations, convolution operations, and batch normalization operations on the features of local detail aggregation in sequence to generate detail enhanced features, the corresponding process has the following relationship: ; in, represents the detail enhancement feature, represents a 1x1 convolution operation, Represents the activation function.
8. The target tracking method based on compact axial attention and detail enhancement according to claim 7, characterized in that: In step 5, the detail fusion features are flattened and concatenated in sequence, and input into the feature fusion module for feature fusion to obtain fusion features containing global context information, which specifically includes the following steps: Performing linear projection processing on the detail fusion features in sequence to obtain a third query vector, a third key vector and a third value vector; Performing target template representation and search area template representation on the third query vector, the third key vector and the third value vector, respectively, to obtain a third query vector, a third key vector and a third value vector represented by the target template, and a third query vector, a third key vector and a third value vector represented by the search area template, respectively; Performing asymmetric cross attention calculation on the third query vector, the third key vector and the third value vector represented by the target template, and the third query vector, the third key vector and the third value vector represented by the search area template, to obtain an attention map of the target template and an attention map of the search area template respectively; The attention map of the target template and the attention map of the search area template are concatenated and linearly projected in turn to obtain a fused feature containing global context information.
9. The target tracking method based on compact axial attention and detail enhancement according to claim 8, characterized in that: In the step of performing asymmetric cross attention calculation on the third query vector, the third key vector and the third value vector represented by the target template, and the third query vector, the third key vector and the third value vector represented by the search area template, respectively obtaining the attention map of the target template and the attention map of the search area template, the relationship between the corresponding processes is as follows: ; in, represents the mixed key vector obtained by concatenating the target template key vector and the search area key vector. a key vector representing the target template, a key vector representing the search region template, represents the mixed key vector obtained by concatenating the target template value vector and the search area value vector. A vector of values representing the target template, A vector of values representing the search region template, represents the attention map of the target, The query vector representing the target template, represents the matrix transpose of the key vector of the target template, represents the attention map of the search area, The query vector representing the search region template, Represents the transpose of the mixed key vector obtained by concatenating the target template key vector and the search area key vector.
10. A target tracking system based on compact axial attention and detail enhancement, characterized in that: The system applies any one of the target tracking methods based on compact axial attention and detail enhancement as claimed in claims 1 to 9, and the system comprises: Building blocks for: Compact axial attention is constructed based on the multi-head attention mechanism, detail enhancement module is constructed based on the channel attention mechanism, feature extraction network is constructed based on compact axial attention and detail enhancement modules, feature fusion module is constructed based on asymmetric cross attention mechanism, and compact axial attention, detail enhancement module and feature extraction network constitute the target tracking model; Learning modules for: Input the template image and the search area image into the feature extraction network for unified feature learning to obtain an output feature map; Based on the output feature map, an optimized feature extraction network is obtained; Pre-trained modules for: Using a large-scale data set, the optimized feature extraction network is pre-trained and parameter-adjusted in sequence to obtain a feature extraction network with adjusted parameters; Extraction module for: The template image and the search area image are input into the parameter-adjusted feature extraction network to extract features and obtain detail fusion features; Compute module for: The detail fusion features are flattened and concatenated in sequence, and then input into the feature fusion module for feature fusion to obtain fusion features containing global context information; Tracking module for: The fused features containing global context information are input into the prediction head to obtain the target tracking frame, and the target tracking frame is tracked using the target tracking model to obtain the tracking result.
Citation Information
Patent Citations
Endoscopic image-based deep fusion intestinal polyp segmentation method and device
CN115965630A
Target tracking method and system based on multi-head attention optimization feature fusion network
CN117274883A