Target tracking network structure based on optical flow compensation and tracking method

By introducing the optical flow compensation module and Transformer feature fusion module into the target tracking network, the problem of target tracking performance degradation under occlusion and illumination changes is solved, higher detection accuracy and robustness are achieved, and the detection accuracy under occlusion environment is significantly improved. tracking effect.

CN118552584AActive Publication Date: 2024-08-27NORTHWESTERN POLYTECHNICAL UNIV

Patent Information

Application Number
CN202410506673.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2024-08-27
Estimated Expiration
2044-04-25

AI Technical Summary

Technical Problem

Existing target tracking algorithms show performance degradation in complex scenes, especially under occlusion and illumination changes, making it difficult to effectively track targets.

Method used

A target tracking network structure based on optical flow compensation is proposed, which uses a backbone network in the form of a twin network, an optical flow-based feature compensation module and a Transformer feature fusion module to repair features damaged by occlusion through local and global compensation mechanisms to improve tracking performance.

Benefits of technology

The accuracy and robustness of target detection are significantly improved in occlusion environments. The average accuracy on the CrowdHuman data set is increased by 0.7%, the logarithmic mean gain of the false positive rate of each image is 0.6%, and the Jacquard index gain is 1%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552584A
    Figure CN118552584A
Patent Text Reader

Abstract

The invention relates to a target tracking network structure based on optical flow compensation and a tracking method, and provides an occluded target detection method based on local perception for target detection in an occluded environment. Specifically, a local sensing module is provided on the feature level, a plurality of local areas are explored through a plurality of local sensing branches, and other branches are forced to learn important local information in highlighted features by using a random discarding strategy. In view of the problem that a detector may predict a plurality of candidate detection boxes, a query updating module is provided. The module uses the spatial position information of the target to eliminate excessive candidate frames, and the accuracy of the detection result is improved. Finally, under a CrowdHuman data set, compared with RT-DETR, the average accuracy index of the algorithm provided by the research is improved by 0.7%, the gain of 0.6% is achieved on the logarithmic mean value of the false positive rate of each image, and the gain of 1% is achieved on the Yaka index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image processing and relates to a target tracking network structure and a tracking method based on optical flow compensation. Background Art

[0002] During the object imaging process, many environmental factors will affect the scene appearance to varying degrees, including different light intensity, different light incident angles, shadows, and posture changes. These changes will eventually appear in the image. Different images will be collected for the same target object in different environmental conditions, which also brings certain difficulties to the subsequent image understanding tasks.

[0003] As a hot topic in the field of computer vision, target tracking has been successfully applied in many fields. Target tracking involves a wide range of disciplines, including pattern recognition, image processing, computer science, mathematical statistics, etc. Existing target tracking algorithms have excellent performance on classic data sets, but if they are applied to complex scenes, such as scenes with a large number of occlusions and scenes with changing lighting, their performance will decrease to a certain extent. Studying target tracking in occluded scenes can not only promote computer vision research on such problems, but also has greater practical significance for the successful application of target tracking technology in civilian and military scenarios.

[0004] Target tracking methods are mainly divided into the following two categories: the first is based on correlation filtering, and the second is based on deep learning.

[0005] Most algorithms based on correlation filtering use filter templates to record and update the location information of the tracked target, and then calculate the similarity between the template image and each position of each frame image, and use the similarity as the output response map. The position with the highest response value in the output response map is the most similar position and the location of the target. Methods based on deep learning use deep neural networks to extract image features. In real life, due to complex situations such as occlusion, illumination changes, and target deformation, image recognition tasks become more difficult. However, target tracking algorithms based on deep learning can effectively cope with these challenges due to their excellent feature extraction capabilities. Compared with algorithms based on correlation filtering, methods based on deep learning can better generalize these complex situations, so they have become the current mainstream research direction. Summary of the invention

[0006] Technical issues to be solved

[0007] In order to avoid the shortcomings of the prior art, the present invention proposes a target tracking network structure and tracking method based on optical flow compensation. In order to solve the problem of feature damage caused by occlusion, an innovative feature compensation module based on optical flow is proposed, so that the search image features can be compensated locally and globally, and finally the impact of occlusion is effectively solved.

[0008] Technical Solution

[0009] An optical flow compensation-based target tracking network structure, characterized by: comprising a twin network-based backbone network, an optical flow-based feature compensation module and a Transformer feature fusion module, as well as a classification head and a regression head;

[0010] The inputs of the backbone network in the form of the twin network are the template image and the search image respectively, the output of the template image backbone network is connected to the first self-attention mechanism module of the Transformer feature fusion module, and is also connected to the feature compensation module based on optical flow, and the output of the search image backbone network is connected to the feature compensation module based on optical flow;

[0011] The Transformer feature fusion module is a context enhancement module based on self-attention and a feature enhancement module based on a cross-attention mechanism that performs feature enhancement in different ways, including two self-attention mechanism modules and three cross-attention mechanism modules; wherein the first self-attention mechanism module is respectively connected to the first cross-attention mechanism module and the second cross-attention mechanism module, the second self-attention mechanism module is respectively connected to the first cross-attention mechanism module and the second cross-attention mechanism module, the outputs of the first cross-attention mechanism module and the second cross-attention mechanism module are connected to the third cross-attention mechanism module, and the outputs of the third cross-attention mechanism module are respectively connected to the classification head and the regression head;

[0012] The optical flow-based compensation module performs feature compensation in different ways by using local occlusion compensation and semantic-based global occlusion compensation, including a local compensation module and a global compensation module; wherein the output of the local compensation module is connected to the global compensation module, and the output of the global compensation module is connected to the Transformer feature fusion module;

[0013] The output of the search image backbone network is connected to the feature compensation module based on optical flow, and then connected to the second self-attention mechanism module of the Transformer feature fusion module.

[0014] The backbone network adopts an improved deep neural network ResNet50, changes the step size of the fourth-layer downsampling unit of the deep neural network from 2 to 1; changes the fourth-layer 3×3 convolution to a dilated convolution with a step size of 2 to obtain a larger receptive field; the backbone network retains the network structure of ResNet50 except for the fully connected layer, which is used to learn and extract the inherent features of the image.

[0015] The optical flow-based feature compensation module includes a local occlusion compensation module and a semantic-based global compensation module, which is used to compensate for image features damaged by occlusion in the search image.

[0016] The backbone networks of the template image and the search image are weight-sharing backbone networks.

[0017] The Transformer feature fusion module includes a context enhancement module based on self-attention and a feature enhancement module based on a cross-attention mechanism, which is used to capture the similarity information between the search image and the template image.

[0018] The target tracking network structure is trained using a training image sample library; the training image sample library is constructed by randomly extracting a number of images required for training from a training image data set, and then randomly selecting an area in each image to generate an occlusion mask; the occlusion images obtained after performing the above operation on all the extracted images constitute the training image sample library.

[0019] The training of the target tracking network structure uses samples from the training image sample library for training, and the Adam optimization method is used to optimize the network. The optimizer parameter betas is set to (0.5, 0.999), the learning rate is 0.0005, the weight_decay is 0.0001, and the batchsize is 20.

[0020] A method for implementing target tracking using the target tracking network structure based on optical flow compensation, characterized in that the target tracking steps are as follows:

[0021] Step 1: The template image and the search image are passed through their respective backbone networks to extract the image features of the template image and the search image;

[0022] Step 2: The template image features and the search image features enter the feature compensation module based on optical flow. The two features are first input into the local occlusion compensation module to calculate the forward optical flow and backward optical flow between the template image features and the search image features. The optical flow consistency test is performed to determine the occlusion area, thereby generating an occlusion mask. The calculation formula is as follows:

[0023]

[0024] Among them, x represents the coordinates of the pixel point, w f (x) represents the forward mapping (warp) operation based on the calculated optical flow, w b It means that the optical flow is mapped backward, α1 and α2 are two adjustment parameters. In the case of no occlusion, the equation on the left tends to 0. If it does not satisfy the equation, it can be considered that there is occlusion. According to the equation, a mask about the occluded area can be calculated. When the corresponding pixel is occluded, the corresponding pixel value on the mask should be 1, otherwise it is 0.

[0025] Integrate the template image features into the occluded area of ​​the search image features to obtain the locally compensated search image features. The calculation formula is as follows:

[0026] F ps =F t *mask+F s *(1-mask)

[0027] Among them, F s To search for image features, F t is the template image feature, F ps The search image features after local feature compensation;

[0028] Step 3: The result processed in step 2 and the template image features are passed through the global compensation module. First, the optical flow of the template image features and the local compensation search image features is calculated. The template image features are mapped by the optical flow, and a weight mask about the important area of ​​the search image is used to fuse the mapped template image features and the local compensation search image features. In this way, the search image features of global compensation are obtained. The calculation formula is as follows:

[0029] F os =mask_p*F ps +(1-mask_p)*F wt

[0030] Among them, F wt Represents the template feature after mapping, F os represents the search image features for global compensation, and mask_p represents the weight mask of the important area of ​​the search image;

[0031] Step 4: The result of step 3, i.e. the search image features compensated by global features, and the template image features are sent to the first self-attention mechanism module through the Transformer feature fusion module. The calculation formula is as follows:

[0032]

[0033] Among them, Q, K, and V are generated by mapping the template image features;

[0034] The output of the first self-attention is sent to the first cross-attention mechanism and the second cross-attention mechanism respectively, and the search image features of the global compensation are sent to the second self-attention mechanism. The calculation method of the second self-attention mechanism is consistent with that of the first self-attention mechanism, but the input is different; the output of the second self-attention mechanism is sent to the first cross-attention mechanism and the second cross-attention mechanism respectively; the calculation formula of the first cross-attention mechanism is consistent with that of the first self-attention mechanism, except that Q is generated by the output mapping of the first self-attention mechanism, and K and V are generated by the output mapping of the second self-attention mechanism; Q of the second cross-attention mechanism is generated by the output mapping of the second self-attention, and K and V are generated by the output mapping of the first self-attention mechanism; the input of the first cross-attention mechanism and the output of the second cross-attention are sent to the third cross-attention mechanism, and the output of the third cross-attention mechanism is sent to the regression head and the classification head;

[0035] Step 5: The result of step 4 is sent to the regression head and the classification head to obtain the final tracking result, that is, the location coordinates of the target.

[0036] The specific process of using the classification head and the regression head to learn and obtain the tracking result in step 5 is:

[0037] Step 5.1: Perform mean subtraction preprocessing on the original template image and the search image, resize the template image to 128*128, and resize the search image to 256*256. When the size exceeds the original image, fill it with the average RGB value; in order to avoid resizing the image during training, each frame of the template image and the search image are extracted offline;

[0038] Step 5.2: Use fine-tuning network training. After the image is mean-reduced and resized, the template image and the search image are sent to the target tracking network for training. During the fine-tuning process, the loss function is defined as the cross entropy function between pixels and the distance function between target positions. The classification result given by the classification head is compared with the corresponding annotation of the image at the pixel level. The classification loss function is:

[0039]

[0040] Among them, y j =1 means that this pixel is a positive sample, p j It represents the probability that the model predicts that it is a positive sample; the target position result given by the regression head is compared with the corresponding annotation position of the image, and the regression loss function is:

[0041]

[0042] It includes L1 loss and GIoU loss; j =1 represents a positive sample, b j represents the target bounding box predicted by the tracking model, represents the normalized predicted target bounding box, λ G Set to 2, λ1 to 5;

[0043] Tracking loss function L occ and L ori The calculation formula is: L track =L cls +L reg .

[0044] Step 5.3: Perform several iterative training on each pair of search images and template images, and judge the model convergence by the change in the value of the loss function until the model reaches a convergence state.

[0045] A computer program product, characterized by comprising computer executable instructions, which are used to implement the method when executed.

[0046] Beneficial Effects

[0047] The present invention proposes a target tracking network structure and tracking method based on optical flow compensation, and proposes an occluded target detection method based on local perception for target detection in an occluded environment. Specifically, a local perception module is proposed at the feature level, which explores multiple local areas through multiple local perception branches and uses a random discarding strategy to force other branches to learn important local information in the prominent features. Considering the problem that the detector may predict multiple candidate detection frames, a query update module is proposed. This module uses the spatial position information of the target to eliminate excessive candidate frames and improve the accuracy of the detection results. Finally, under the CrowdHuman dataset, the average accuracy index of the algorithm proposed in this study is improved by 0.7% compared with RT-DETR, the logarithmic mean of the false positive rate of each image has achieved a gain of 0.6%, and the Yaka index has achieved a gain of 1%. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 The overall framework diagram of the network

[0049] Figure 2 Illustration of two residual structures

[0050] Figure 3 Schematic diagram of the local occlusion compensation module

[0051] Figure 4 Schematic diagram of the global feature compensation module

[0052] Figure 5 Schematic diagram of self-attention

[0053] Figure 6 Schematic diagram of cross attention

[0054] Figure 7 Heat map of the global feature compensation module

[0055] Figure 8 Heat map of the partial occlusion compensation module

[0056] Fig. 9 The success rate and accuracy graphs of various target tracking algorithms on the OTB-occlusion dataset DETAILED DESCRIPTION

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

[0058] The present invention explores and proposes a new target tracking algorithm based on optical flow compensation. In terms of the backbone network, taking the ResNet50 algorithm as the prototype, the present invention changes the step size of the fourth-layer downsampling unit from 2 to 1, thereby improving the receptive field of the network. In terms of the feature compensation module based on optical flow, the present invention innovatively proposes local and global feature compensation, obtains global features that fuse temporal template features and current features after local occlusion compensation and global semantic compensation for the backbone network features, and sends them to the Transformer feature fusion module. This module repairs the damaged features and improves the tracking effect. In the Transformer feature fusion module, the present invention adds self-attention and cross-attention combination modules. On the one hand, a long-distance dependency relationship is established through a self-attention-based context enhancement module, so that each feature point pays attention to the useful information in the image to enhance the feature representation of the image itself. On the other hand, the feature representation of the template image and the search image is enhanced through a residual structure based on cross-attention. The module uses the template image features and the search image features as input, which not only establishes the global relationship between the template image and the search image, but also captures the correlation information between the search image and the template image. A feature fusion module combining self-attention and cross-attention is used to capture global aggregate features that are more beneficial to tracking tasks.

[0059] In order to achieve the above objectives, the present invention proposes a target tracking network and method based on optical flow compensation, whose network structure is as follows: Figure 1 As shown, it includes the following network structures and target tracking steps:

[0060] Step 1: Build a training image sample library

[0061] (1) Build a training image sample library

[0062] The present invention randomly extracts a certain number of images from a training image data set, and then randomly selects an area in each image to generate an occlusion mask; the occlusion images obtained after performing the above operation on all the extracted images constitute a training image sample library.

[0063] In the embodiment: LaSOT and GOT-10K target tracking data sets are used. In the LaSOT data set, a total of 1400 video clips with a total of 3500000 frames are included, wherein each video sequence contains an average of 2500 frames. Among the 1400 video sequences, 511 are divided into test video sequences, and the rest are classified as training data. The video sequences of LaSOT are all derived from real life, and this feature is very suitable for single target tracking tasks. The GOT-10K data set is a large-scale data set like LaSOT, which is also the single target tracking data set with the richest target categories at present. GOT-10K contains a total of 87 sports and 563 categories, such as tennis, cycling, running, football, etc. This data set contains a total of 10180 video clips, wherein 180 are test sequences, and 10000 video sequences are training data.

[0064] The present invention further improves the use of an incremental generation occlusion module on the basis of generating occlusion on an image. For the incremental generation occlusion module, its increment means that the size of the generated occlusion area is not maintained unchanged from beginning to end. The size of the occlusion area will increase as the number of network training rounds increases. The present invention achieves the effect of training data from easy to difficult by continuously increasing the occlusion area, allowing the algorithm to start learning from easy data first, first learn how to solve simple occlusion situations, and then gradually increase the occlusion area to allow the algorithm to contact difficult data with more serious occlusion. The ability of the algorithm to solve occlusion is gradually improved through the easy to difficult mode. If the network is exposed to the most difficult occlusion data at the beginning, the network may not be able to learn effective information from these data at the beginning, and from easy to difficult is more in line with the learning law. In addition, there is no artificially set strategy for the position of the generated occlusion area in the image, and the algorithm will randomly select the position where the occlusion area is located. The randomness of selecting the occlusion area also means that the target may not be occluded, so this randomized strategy can include both occlusion and non-occlusion situations.

[0065] Step 2: Build the target tracking network

[0066] according to Figure 1 , Figure 2 , Figure 3 , Figure 4 as well as Figure 5, the target tracking network is constructed using the method in step 2. The search image and the template image are passed through the backbone network to obtain the image features of the two, and then the two are sent to the feature compensation module based on optical flow to obtain the local and global compensated search image features. Finally, the compensated search image features and template image features are sent to the Transformer feature fusion module for feature fusion.

[0067] (1) Building a backbone network

[0068] The backbone network is based on the ResNet50 network structure. The step size of the downsampling unit in the fourth layer of ResNet50 is changed from 2 to 1 to improve the network's receptive field. In addition, the 3×3 convolution in the fourth convolutional layer of ResNet50 is changed to a dilated convolution with a step size of 2 to obtain a larger receptive field. The backbone network uses two different residual structures, such as Figure 2 As shown in the figure, the backbone network contains 5 convolutional layers, namely conv1, conv2.x, conv3.x, conv4.x, and conv5.x. Except for conv1, the other convolutional layers of the backbone network are composed of multiple basic residual modules. The convolutional units conv2.x, conv3.x, conv4.x, and conv5.x stack 3, 4, 6, and 3 basic residual modules respectively.

[0069] (2) Constructing a feature compensation module based on optical flow

[0070] For the local occlusion compensation module, its structural diagram is as follows Figure 3 As shown. This module is used to determine the occlusion area. This paper proposes to use the optical flow consistency criterion. The optical flow consistency criterion means that if there is no occlusion, the forward mapped optical flow vector can be restored to its original position when it is mapped backward. If there is occlusion, for example, a person walking on the street is blocked by trees, cars and other objects on the street, then the blocked part of the pedestrian cannot find the corresponding area in the next frame. Therefore, the criterion for judging whether there is occlusion is that after the current optical flow passes through forward mapping and backward mapping, if the current optical flow cannot return to its original position, it can be considered as occlusion, as shown in formula (1):

[0071]

[0072] Among them, x represents the coordinates of the pixel point, w f (x) represents the forward mapping (warp) operation based on the calculated optical flow, w bIt means that the optical flow is mapped backward, and α1 and α2 are two adjustment parameters. In the absence of occlusion, the equation on the left side of equation (1) tends to 0. If equation (1) is not satisfied, it can be considered that there is occlusion. According to equation (1), a mask about the occluded area can be calculated. When the corresponding pixel is occluded, the corresponding pixel value on the mask should be 1, otherwise it is 0. In this module, the search image features and template image features are first used to calculate the forward optical flow and backward optical flow between the two. The forward optical flow and backward optical flow are used to perform optical flow consistency check to determine the occluded area, and finally generate an occlusion mask. Then, the search image features of the occluded area are fused with the template image features using the occlusion mask to repair the features of the occluded area to a certain extent, and finally a search image feature with local feature compensation is obtained.

[0073] For the global feature compensation module, its structural diagram is as follows: Figure 4 As shown in Figure 1, this module first uses the search features after occlusion compensation to map and match the template features, thereby obtaining template features that are semantically aligned with the search features, as shown in Figure 1. Figure 4 Then, the attention module is used to capture the information that needs to be focused on in the search image, so as to maintain the original attention level of the important areas of the search image features. At the same time, the temporal information of the template features can be used to highlight some neglected image areas. Figure 4 The attention mask in will be used to fuse the semantically aligned template image with the occlusion-compensated search features to obtain a global feature that fuses the temporal template features with the current search features. The present invention proposes to use a semantically aligned template image to perform feature compensation on the search image to ensure that some potentially important areas in the search image features are focused on. This module aims to retain the information that should be focused on in the search image, while using the template image to enrich the temporal information so as to mine more valuable areas.

[0074] (3) Constructing a Transformer-based feature fusion module

[0075] The function of this module is to capture the correlation information between the search image and the template image through feature fusion, which is used for feature fusion between the search image and the template image. This module uses Transformer to construct a self-attention-based context enhancement module and a cross-attention-based feature fusion module. Both modules perform feature enhancement in different ways.

[0076] For the context enhancement module based on self-attention, its structural diagram is as follows Figure 5As shown in the figure. This module is a residual structure based on the self-attention mechanism. This module establishes long-distance dependencies through the self-attention mechanism calculation of the image itself, so that each feature point pays attention to the useful information in the image to enhance the feature representation of the image itself. As for the search image, this module first pulls the search image features fed into the backbone network into a long vector for use by the Transformer module, and then uses the search image vector mapping to generate the query matrix Q, key matrix K, and value matrix V required by the Transformer.

[0077] For the feature enhancement module based on cross attention, its structural diagram is as follows Figure 6 As shown. This module is a residual structure based on the multi-head cross-attention mechanism. For the cross-attention feature enhancement module of the search image, it introduces the template image feature as another input based on itself as input. This module cross-attentionally fuses two features through the cross-attention mechanism of Transformer, which can perform global and nonlinear feature fusion, capturing the global information of the features while retaining a large amount of rich semantic information. Compared with the context enhancement module based on self-attention, the query matrix Q and the key matrix K of this module do not come from the same object, while the query matrix Q and the key matrix K in the context enhancement module based on self-attention come from the same object.

[0078] In the entire Transformer-based feature fusion module, there are two context enhancement modules based on the self-attention mechanism and two feature enhancement modules based on the cross-attention mechanism. Two context enhancement modules based on the self-attention mechanism and two feature enhancement modules based on the cross-attention mechanism constitute a feature fusion layer. The number of feature fusion cycles is N times, and finally input into a feature enhancement module based on the cross-attention mechanism to decode and obtain the final fusion feature. The entire feature fusion module captures global aggregate features that are more conducive to target tracking tasks through multiple self-feature enhancements and cross-feature enhancements.

[0079] Step 3: Define the loss function

[0080] According to formulas (2)-(5), the present invention calculates the generator loss function.

[0081] When calculating the classification loss, the present invention forces the network to update its own parameters so that the tracking head can accurately determine the positive samples and negative samples in the image.

[0082] In order to better reflect the degree of overlap between any two boxes when calculating the regression loss, the present invention uses GiOU loss.

[0083] (1) Define the target tracking network loss as shown in formula (2):

[0084] L all =αL occ +βL ori (2)

[0085] Among them, L occ represents the tracking loss obtained by using the occluded search image and the template image, L ori Represents the tracking loss obtained using the original search image and the template image, and α and β are the weights of the two losses. The present invention can generate a search image affected by occlusion through an incremental occlusion generation module. During training, this article does not discard the original search image, but sends the occluded search image, the original search image and the template image together into the tracking network, that is, the network input has two search images and one template image. The training design in this chapter is to hope that when training for occluded data, the tracking performance of the tracking algorithm in ordinary scenes will not be reduced, so the occluded search image and the template image are added to the training together. A set of classification loss and regression loss can be obtained using the occluded search image and the template image, and a set of classification loss and regression loss can also be obtained using the original search image and the template image.

[0086] Tracking loss function L occ and L ori The calculation formula is shown in formula (3):

[0087] L track =L cls +L reg (3)

[0088] Among them, L track represents the tracking loss function, L cls represents the classification loss, L reg represents the regression loss.

[0089] Classification loss function L cls The calculation formula is shown in formula (4):

[0090] L cls =-∑ j [y j log(p j )+(1-y j )log(1-p j )] (4)

[0091] This loss is the cross entropy loss, and both positive and negative samples participate in the calculation of this loss. j =1 means that this pixel is a positive sample, p jIt represents the probability that the model predicts that it is a positive sample. To minimize the loss, the tracking network needs to be forced to update its own parameters so that the tracking head can accurately determine the positive and negative samples in the image.

[0092] Regression loss function L reg The calculation formula is shown in formula (5):

[0093]

[0094] The regression loss is composed of L1 loss and GIoU loss, and only positive samples participate in the regression loss calculation. j =1 represents a positive sample, b j represents the target bounding box predicted by the tracking model, represents the normalized predicted target bounding box, λ G is set to 2 and λ1 is set to 5.

[0095] Step 4: Network training

[0096] Use the training image sample library constructed in step 1 to train the target tracking network in step 2, use the Adam optimization method to update the network parameters, stop training when the loss function value defined in step 3 is the minimum, and obtain the final target tracking network;

[0097] The optimizer parameters betas are set to (0.5, 0.999), the learning rate is 0.0005, the weight_decay is 0.0001, and the batchsize is 20.

[0098] Step 5: Input the original images to be processed into the occluded images obtained in step 1 and send them into the target tracking network. The output result is the tracking result.

[0099] In order to comprehensively evaluate the effect of the algorithm proposed in the present invention, the present invention first analyzes the effect of the feature compensation module based on optical flow, and then compares and evaluates it in terms of visualization effect and quantitative indicators on the OTB-occlusion target tracking dataset and the VOT-occlusion target tracking dataset.

[0100] (1) Evaluation of global feature compensation module

[0101] In order to measure the effectiveness of the global feature compensation module, the present invention is evaluated on the VOT-occlusion dataset. The present invention designs a set of comparative experiments to evaluate the global feature compensation module.

[0102] (a) Use optical flow method to compensate and search the global feature module of the image.

[0103] (b) Optical flow is not used to compensate for the global features of the search image.

[0104] With other variables unchanged, the present invention trains the above two networks, and the final result indicators on the VOT-occlusion dataset are shown in Table 1.

[0105] Table 1 Comparison table with and without global feature compensation module (black marks are the best)

[0106]

[0107] It can be concluded from Table 1 that although there are some shortcomings in the robustness performance, using the optical flow method to compensate for the global features of the search frame will obtain better overall performance and better average accuracy. This also shows that using the optical flow method to supplement the global features of the search frame can maintain good accuracy on the entire data set and will not make the tracking algorithm have a certain tendency to certain scenes. Figure 7 Shows the heat map of the global feature compensation module, generated using Grad-CAM. Figure 7 It can be observed that after global feature compensation, attention is not only focused on the boundary area of ​​the target, but also covers the target itself. Figure 3-6 In the example, the features not only focus on the boy’s face that is blocked by the magazine, but also on the unblocked face. This focus on both blocked and unblocked areas helps to obtain more robust features, thus improving tracking results.

[0108] (2) Evaluation based on local occlusion compensation module

[0109] In order to measure the effectiveness of the local occlusion compensation module, the present invention is evaluated on the VOT-occlusion dataset. The present invention designs a set of comparative experiments to evaluate the local occlusion compensation module.

[0110] (a) The optical flow method is used to compensate for the features of the occluded area in the search image.

[0111] (b) Instead of using the optical flow method to compensate for the features of the occluded area of ​​the search image, the optical flow method is directly used to compensate for the global features of the image.

[0112] With other variables unchanged, the present invention trains the above two networks, and the final result indicators on the VOT-occlusion dataset are shown in Table 2.

[0113] Table 2 Comparison table of the module with and without partial occlusion compensation (the black one is the best)

[0114]

[0115] As can be seen from Table 2, solution a, which uses the optical flow method to perform feature compensation on the occluded area of ​​the search image, is superior to solution b, which does not use the optical flow method, in all indicators of the data set. Solution a is not only superior to solution b in average accuracy and comprehensive performance, but also superior to solution b in tracking robustness. This comparative experiment proves the effectiveness of using the optical flow method to perform feature compensation on the search image. Feature compensation for the occluded area of ​​the search image can enhance the feature representation of the search image and supplement the feature representation of the occluded area in the search image. The compensated search image features are more helpful for the model to predict the final tracking results. Figure 8 Shows a heat map of the local occlusion compensation module, generated using Grad-CAM. Figure 8 It can be seen from that after local occlusion compensation, the features are focused on the boundary area of ​​the target and some important areas will not be ignored due to occlusion. Figure 8 Although the boy’s face is blocked by the magazine, the features are still able to focus on the blocked facial area.

[0116] According to the above indicators and visualization results, it can be concluded that the feature compensation based on optical flow proposed by the present invention has a significant effect on solving the occlusion problem in the target tracking task, and has a significant improvement in the robustness of the image and the tracking accuracy. After the action of the feature compensation module based on optical flow, the present invention can effectively repair the image features lost due to occlusion.

[0117] (2) Analysis of experimental results of OTB-occlusion dataset

[0118] In order to verify the universality of the method proposed in the present invention on different data sets, the present invention also tests the OTB-occlusion data set. The present invention selects a subset of the OTB100 data set with occlusion labels as the test set, and the specific quantitative indicators are shown in Table 3. It can be seen that the method proposed in the present invention also achieves the best effect on the OTB-occlusion data set, proving the effectiveness of the method. Fig. 9 The success rate and accuracy graphs of various target tracking algorithms on the OTB-occlusion dataset.

[0119] Table 3 Comparison of tracking results of various tracking algorithms on the OTB-occlusion dataset

[0120]

Claims

1. A target tracking network structure based on optical flow compensation, Features: It includes a backbone network in the form of a twin network, a feature compensation module based on optical flow, a Transformer feature fusion module, and a classification head and a regression head; The inputs of the backbone network in the form of the twin network are the template image and the search image respectively, the output of the template image backbone network is connected to the first self-attention mechanism module of the Transformer feature fusion module, and is also connected to the feature compensation module based on optical flow, and the output of the search image backbone network is connected to the feature compensation module based on optical flow; The Transformer feature fusion module is a context enhancement module based on self-attention and a feature enhancement module based on a cross-attention mechanism that performs feature enhancement in different ways, including two self-attention mechanism modules and three cross-attention mechanism modules; wherein the first self-attention mechanism module is respectively connected to the first cross-attention mechanism module and the second cross-attention mechanism module, the second self-attention mechanism module is respectively connected to the first cross-attention mechanism module and the second cross-attention mechanism module, the outputs of the first cross-attention mechanism module and the second cross-attention mechanism module are connected to the third cross-attention mechanism module, and the outputs of the third cross-attention mechanism module are respectively connected to the classification head and the regression head; The optical flow-based compensation module performs feature compensation in different ways by using local occlusion compensation and semantic-based global occlusion compensation, including a local compensation module and a global compensation module; wherein the output of the local compensation module is connected to the global compensation module, and the output of the global compensation module is connected to the Transformer feature fusion module; The output of the search image backbone network is connected to the feature compensation module based on optical flow, and then connected to the second self-attention mechanism module of the Transformer feature fusion module.

2. According to the target tracking network structure based on optical flow compensation according to claim 1, Features: The backbone network adopts an improved deep neural network ResNet50, changes the step size of the fourth-layer downsampling unit of the deep neural network from 2 to 1; changes the fourth-layer 3×3 convolution to a dilated convolution with a step size of 2 to obtain a larger receptive field; the backbone network retains the network structure of ResNet50 except for the fully connected layer, which is used to learn and extract the inherent features of the image.

3. According to the target tracking network structure based on optical flow compensation as claimed in claim 1, Features: The optical flow-based feature compensation module includes a local occlusion compensation module and a semantic-based global compensation module, which is used to compensate for image features damaged by occlusion in the search image.

4. According to the target tracking network structure based on optical flow compensation as claimed in claim 1, Features: The backbone networks of the template image and the search image are weight-sharing backbone networks.

5. According to the target tracking network structure based on optical flow compensation as claimed in claim 1, Features: The Transformer feature fusion module includes a context enhancement module based on self-attention and a feature enhancement module based on a cross-attention mechanism, which is used to capture the similarity information between the search image and the template image.

6. According to the target tracking network structure based on optical flow compensation as claimed in claim 1, Features: The target tracking network structure is trained using a training image sample library; the training image sample library is constructed by randomly extracting a number of images required for training from a training image data set, and then randomly selecting an area in each image to generate an occlusion mask; the occlusion images obtained after performing the above operation on all the extracted images constitute the training image sample library.

7. According to claim 6, the target tracking network structure based on optical flow compensation, Features: The training of the target tracking network structure uses samples from the training image sample library for training, and the Adam optimization method is used to optimize the network. The optimizer parameter betas is set to (0.5, 0.999), and the learning rate is 0.0005. weight_decay is 0.0001 and batchsize is 20.

8. A method for implementing target tracking using the target tracking network structure based on optical flow compensation according to any one of claims 1 to 7, Features The target tracking steps are as follows: Step 1: The template image and the search image are passed through their respective backbone networks to extract the image features of the template image and the search image; Step 2: The template image features and the search image features enter the feature compensation module based on optical flow. The two features are first input into the local occlusion compensation module to calculate the forward optical flow and backward optical flow between the template image features and the search image features. The optical flow consistency test is performed to determine the occlusion area, thereby generating an occlusion mask. The calculation formula is as follows: Among them, x represents the coordinates of the pixel point, w f (x) represents the forward mapping (warp) operation based on the calculated optical flow, w b It means that the optical flow is mapped backwards, α 1 and α 2 are two adjustment parameters; in the case of no occlusion, the equation on the left tends to 0. If it does not satisfy the equation, it can be considered that there is occlusion. According to the equation, a mask about the occluded area can be calculated. When the corresponding pixel point is occluded, the corresponding pixel point value on the mask should be 1, otherwise it is 0. Integrate the template image features into the occluded area of ​​the search image features to obtain the locally compensated search image features. The calculation formula is as follows: F ps =F t *mask+F s *(1-mask) Among them, F s To search for image features, F t is the template image feature, F ps The search image features after local feature compensation; Step 3: The result processed in step 2 and the template image features are passed through the global compensation module. First, the optical flow of the template image features and the local compensation search image features is calculated. The template image features are mapped by the optical flow, and a weight mask about the important area of ​​the search image is used to fuse the mapped template image features and the local compensation search image features. In this way, the search image features of global compensation are obtained. The calculation formula is as follows: F os =mask-p*F ps +(1-mask-p)*F wt Among them, F wt Represents the template feature after mapping, F os represents the search image features for global compensation, and mask_p represents the weight mask of the important area of ​​the search image; Step 4: The result of step 3, i.e. the search image features compensated by global features, and the template image features are sent to the first self-attention mechanism module through the Transformer feature fusion module. The calculation formula is as follows: Among them, Q, K, and V are generated by mapping the template image features; The output of the first self-attention is sent to the first cross-attention mechanism and the second cross-attention mechanism respectively, and the search image features of the global compensation are sent to the second self-attention mechanism. The calculation method of the second self-attention mechanism is consistent with that of the first self-attention mechanism, but the input is different; the output of the second self-attention mechanism is sent to the first cross-attention mechanism and the second cross-attention mechanism respectively; the calculation formula of the first cross-attention mechanism is consistent with that of the first self-attention mechanism, except that Q is generated by the output mapping of the first self-attention mechanism, and K and V are generated by the output mapping of the second self-attention mechanism; Q of the second cross-attention mechanism is generated by the output mapping of the second self-attention, and K and V are generated by the output mapping of the first self-attention mechanism; the input of the first cross-attention mechanism and the output of the second cross-attention are sent to the third cross-attention mechanism, and the output of the third cross-attention mechanism is sent to the regression head and the classification head; Step 5: The result of step 4 is sent to the regression head and the classification head to obtain the final tracking result, that is, the location coordinates of the target.

9. The method according to claim 6, Features: The specific process of using the classification head and the regression head to learn and obtain the tracking result in step 5 is: Step 5.1: Perform mean subtraction preprocessing on the original template image and the search image, resize the template image to 128*128, and resize the search image to 256*256. When the size exceeds the original image, fill it with the average RGB value; in order to avoid resizing the image during training, each frame of the template image and the search image are extracted offline; Step 5.2: Use fine-tuning network training. After the image is mean-reduced and resized, the template image and the search image are sent to the target tracking network for training. During the fine-tuning process, the loss function is defined as the cross entropy function between pixels and the distance function between target positions. The classification result given by the classification head is compared with the corresponding annotation of the image at the pixel level. The classification loss function is: Among them, y j =1 means that this pixel is a positive sample, p j It represents the probability that the model predicts that it is a positive sample; the target position result given by the regression head is compared with the corresponding annotation position of the image, and the regression loss function is: This includes L 1 loss and GIoU loss; y j =1 represents a positive sample, b j represents the target bounding box predicted by the tracking model, represents the normalized predicted target bounding box, λ G Set to 2, λ 1 Set to 5; Tracking loss function L occ and L ori The calculation formula is: L track =L cls +L reg ; Step 5.3: Perform several iterative training on each pair of search images and template images, and judge the model convergence by the change in the value of the loss function until the model reaches a convergence state.

10. A computer program product, Features The invention comprises computer executable instructions, which are used to implement the methods of claims 8 to 9 when being executed.

Citation Information

Patent Citations

  • Depth target tracking method in complex environment

    CN111640136A

  • Unsupervised optical flow estimation method based on Transform feature pyramid network

    CN114187331A

  • Feature fusion target tracking method based on attention mechanism

    CN116310683A

  • Single target tracking method and tracking system based on channel attention and space-time perception

    CN116797799A

  • Target tracking method and device, equipment and medium

    CN117830356A

Cited By

  • Anti-jitter method and device based on vehicle-mounted pavement disease recognition system

    CN119228849A

  • Multi-target tracking method and system based on optical flow information and identity prediction

    CN119919449A