A template updating method for single target image tracker based on Siamese network

Through the template update method based on the twin network, the Euclidean distance between the candidate template features and the true value features is calculated, and the anchor box with the minimum distance is selected for tracking, which solves the problem of insufficient template update mechanism in the existing technology and realizes a single-target image tracker Fast and accurate tracking and efficient updates in complex changing situations.

CN114581479BActive Publication Date: 2024-09-24HUNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210266386.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-17
Publication Date
2024-09-24
Estimated Expiration
2042-03-17

Smart Images

  • Figure CN114581479B
    Figure CN114581479B
Patent Text Reader

Abstract

The present invention discloses a template updating method based on a twin network single target image tracker, including collecting image data, cutting data, obtaining a training data set; constructing an image tracking model for extracting features; inputting the training data set into the image tracking model for training to obtain a trained image tracking model; calculating candidate template features; evaluating the candidate template features through the trained image tracking model, calculating the Euclidean distance between the updated template and the true value features of the next frame, and sorting the Euclidean distance; selecting an anchor frame with the smallest Euclidean distance, and tracking the target selected in the current image. The present invention utilizes the features of the cumulative template so that the content of each frame change of the object will be reflected in the cumulative template, and predicting the template of the next frame is more accurate than simple linear interpolation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision, and in particular relates to a template updating method based on a twin network single target image tracker. Background Art

[0002] In single object tracking, most trackers either use simple linear interpolation to update the template for each frame, or do not update the initial template. Such an update mechanism is not sufficient in most tracking situations because the target object may change in appearance due to deformation, fast motion or occlusion. In addition, the unchanging update rule will cause the object template to pay more attention to the most recent frame and forget the historical shape changes of the object.

[0003] However, most update techniques are based on an assumption that the appearance of an object changes smoothly in consecutive frames. This template averaging method provides a means to integrate new information, but there are the following problems: 1. A constant update rate is used for each video, but multiple elements will result in different update requirements; 2. The update function is limited to the previous appearance template, which severely limits the flexibility of the update mechanism. When the target undergoes complex changes, this update mechanism may not work, tracking is inaccurate, and efficiency is low. Summary of the invention

[0004] The purpose of the present invention is to provide a template updating method based on a twin network single target image tracker, which can be updated flexibly and track a single target quickly and accurately.

[0005] The template updating method based on the twin network single target image tracker provided by the present invention comprises the following steps:

[0006] S1. Collect image data, perform data cropping, and obtain training data sets;

[0007] S2. Build an image tracking model for feature extraction;

[0008] S3. Inputting the training data set into the image tracking model for training to obtain a trained image tracking model;

[0009] S4. Calculate candidate template features;

[0010] S5. Evaluate the candidate template features through the trained image tracking model, calculate the Euclidean distance between the updated template and the ground-truth feature of the next frame, and sort the Euclidean distance;

[0011] S6. Select the anchor frame with the smallest Euclidean distance and track the target selected in the current image.

[0012] In the step S1, the training data set includes the LaSOT data set.

[0013] In the step S2, an image tracking model is constructed using the AlexNet structure.

[0014] The step S4 comprises the following steps:

[0015] A1. Taking each pixel as the center, select the area size of the anchor box, set the aspect ratio of the anchor box, and calculate the width x and height y of the anchor box;

[0016] A2. For each pixel in the image, generate several different anchor boxes with equal areas according to the aspect ratio;

[0017] A3. Calculate the intersection-and-union ratio of the anchor frame and the Ground-Truth of the frame, and select several anchor frames whose intersection-and-union exceeds the set threshold;

[0018] A4. Use the network to extract features from the selected anchor frame to obtain N candidate template features

[0019] The step A1 includes setting the area size s of the anchor frame, s∈(0,1], and setting the aspect ratio of the anchor frame r>0, the image height is h, and the width is w; obtaining the width x and the height y of the anchor frame,

[0020] The step A2 includes setting a set of anchor boxes to have an area size of [s1,...,s n ], there are n different areas, set a set of anchor box width-height ratios [r1,...,r m ], there are m different aspect ratios, there are m·n combinations of the area size of the anchor box and the aspect ratio of the anchor box, the number of pixels in the image is w·h, and there are w·h·m·n anchor boxes in total.

[0021] The step A3 includes an intersection-and-union ratio of ; Set the threshold to 0.6, if the intersection ratio , then retain the anchor frame, if the intersection is , then the anchor box is discarded; if N anchor boxes are obtained that exceed the set threshold, the optimal feature T among the N anchor boxes is obtained i , i represents the number of video frames.

[0022] The step A4 includes N candidate template features for:

[0023]

[0024] Among them, Φ(·) represents the trained framework; Represents the characteristics of the historical accumulation template; T i represents the optimal feature in the anchor box; Represents the Ground-Truth feature of the initial frame; i represents the number of frames in the video; GT represents the true value.

[0025] The step S5, evaluating includes 5 layers of convolutional neural network and 3 layers of fully connected layers; the 5 layers of convolutional neural network include convolutional first layer, convolutional second layer, convolutional third layer, convolutional fourth layer and convolutional fifth layer; convolutional first layer includes convolutional layer 1 and maximum pooling layer 1; convolutional second layer includes convolutional layer 2 and maximum pooling layer 2; convolutional third layer includes convolutional layer 3; convolutional fourth layer includes convolutional layer 4; convolutional fifth layer includes convolutional layer 5; convolutional layer 1 The convolution kernel is 11*11, and the skip shift is 2; the convolution kernel of the maximum pooling layer 1 is 3*3, and the skip shift is 4; the convolution kernel of the convolution layer 2 is 5*5; the convolution kernel of the maximum pooling layer 2 is 3*3, and the skip shift is 2; the convolution kernel of the convolution layer 3 is 3*3; the convolution kernel of the convolution layer 4 is 3*3, and the convolution kernel of the convolution layer 5 is 3*3; the 3-layer fully connected layer includes fully connected layer 1, discard layer 1, fully connected layer 2, discard layer 2, and fully connected layer 3;

[0026] Calculate the Euclidean distance between the result and the Ground-Truth feature of the i+1th frame:

[0027]

[0028] Among them, |·|2 represents the Euclidean distance between two values; Φ(·) represents the trained framework; Represents the characteristics of the historical accumulation template; T i represents the optimal feature in the anchor box; Represents the Ground-Truth feature of the initial frame; Represents the Ground-Truth feature of the i+1th frame; i represents the number of frames in the video; GT represents the true value.

[0029] The template updating method based on the twin network single target image tracker provided by the present invention utilizes the characteristics of the cumulative template so that the content of the object changes in each frame will be reflected in the cumulative template, and the prediction of the next frame template will be more accurate than simple linear interpolation. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic diagram of the process of the present invention.

[0031] Figure 2-3 This is a schematic diagram of the image tracker obtained by an embodiment of the present invention tracking players in a basketball game. DETAILED DESCRIPTION

[0032] like Figure 1 The schematic diagram of the structure of the system of the present invention is as follows: The template updating method based on the twin network single target image tracker provided by the present invention comprises the following steps:

[0033] S1. Collect image data, perform data cropping, and obtain training data sets;

[0034] S2. Build an image tracking model for feature extraction;

[0035] S3. Inputting the training data set into the image tracking model for training to obtain a trained image tracking model;

[0036] S4. Calculate candidate template features;

[0037] S5. Evaluate the candidate template features through the trained image tracking model, calculate the Euclidean distance between the updated template and the ground-truth feature of the next frame, and sort the Euclidean distance;

[0038] S6. Select the anchor frame with the smallest Euclidean distance and track the target selected in the current image.

[0039] In step S1, the training data set includes a LaSOT data set;

[0040] In step S2, an image tracking model is constructed using the AlexNet structure;

[0041] The step S4 comprises the following steps:

[0042] A1. Centering each pixel, select the area size s of the anchor box, s∈(0,1], set the aspect ratio of the anchor box r>0, and calculate the width x and height y of the anchor box; including, setting the image height as h and width as w;

[0043] According to the properties of the anchor box, we can get xy=s, r=x / y, and obtain the normalized width x and height y of the anchor box. The normalized width and height calculated are relative to the original image, so they are multiplied by the width and height of the original image to obtain the width x and height y of the anchor box.

[0044] A2. For each pixel in the image, generate several different anchor boxes with equal areas according to the aspect ratio; including setting the area size of a set of anchor boxes to [s1,...,s n ], set a set of anchor box aspect ratios [r1,...,r m], since there are m·n combinations of the area size of the anchor box and the aspect ratio of the anchor box, and the number of pixels in the image is w·h, there are a total of w·h·m·n anchor boxes.

[0045] A3. Calculate the intersection-union ratio of the anchor frame and the Ground-Truth of the frame, and select several anchor frames whose intersection-union exceeds the set threshold; the intersection-union ratio is In this embodiment, the threshold is set to 0.6. , then retain the anchor frame, if the intersection is , then the anchor box is discarded; if N anchor boxes are obtained that exceed the set threshold, the optimal feature T among the N anchor boxes is obtained i , i represents the number of video frames;

[0046] A4. Use the network to extract features from the selected anchor frame to obtain N candidate template features

[0047]

[0048] Among them, Φ(·) represents the trained framework; Represents the characteristics of the historical accumulation template; T i represents the optimal feature in the anchor box; Represents the Ground-Truth feature of the initial frame; i represents the number of frames in the video; GT represents the true value.

[0049] In the step S5, a 5-layer convolutional neural network and a 3-layer fully connected layer are used for evaluation; the 5-layer convolutional neural network includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer and a fifth convolutional layer; the first convolutional layer includes a convolutional layer 1 and a maximum pooling layer 1; the second convolutional layer includes a convolutional layer 2 and a maximum pooling layer 2; the third convolutional layer includes a convolutional layer 3; the fourth convolutional layer includes a convolutional layer 4; the fifth convolutional layer includes a convolutional layer 5; the convolutional kernel of the convolutional layer 1 is 11*11, stride is 2; the convolution kernel of the maximum pooling layer 1 is 3*3, stride is 4; the convolution kernel of the convolution layer 2 is 5*5; the convolution kernel of the maximum pooling layer 2 is 3*3, stride is 2; the convolution kernel of the convolution layer 3 is 3*3; the convolution kernel of the convolution layer 4 is 3*3, and the convolution kernel of the convolution layer 5 is 3*3; the 3-layer fully connected layer includes fully connected layer 1, discard layer 1, fully connected layer 2, discard layer 2, and fully connected layer 3;

[0050] Calculate the Euclidean distance between the result and the Ground-Truth feature of the i+1th frame:

[0051]

[0052] Among them, |·|2 represents the Euclidean distance between two values; Φ(·) represents the trained framework; Represents the characteristics of the historical accumulation template; T i represents the optimal feature in the anchor box; Represents the Ground-Truth feature of the initial frame; Represents the Ground-Truth feature of the i+1th frame; i represents the number of frames in the video; GT represents the true value.

[0053] In this embodiment, the present invention uses different trackers to conduct comparative experiments on the VOT2017 dataset;

[0054] Table 2

[0055]

[0056] The experimental results show that the present invention can improve the accuracy of existing methods. Table 2 shows the experimental results of the present invention on the VOT2017 dataset. EAO, A and R are performance indicators. The larger the first two values, the better, and the smaller the latter value, the better. Ours is the indicator result of the present invention. Figure 2-3 This is a schematic diagram of the image tracker obtained by the embodiment of the present invention tracking players in a basketball game. The tracking is accurate and efficient.

Claims

1. A template updating method based on a siamese network single target image tracker, characterized in that The steps include: S1. Collect image data, perform data cropping, and obtain training data sets; S2. Build an image tracking model for feature extraction; S3. Inputting the training data set into the image tracking model for training to obtain a trained image tracking model; S4. Calculate candidate template features; The steps include: A1. Taking each pixel as the center, select the area size of the anchor box, set the aspect ratio of the anchor box, and calculate the width x and height y of the anchor box; specifically, set the area size s of the anchor box, s∈(0,1], and set the aspect ratio of the anchor box r>0, the image height is h, and the width is w; obtain the width x and height y of the anchor box, A2. For each pixel in the image, generate several different anchor boxes with equal areas according to the aspect ratio; including setting the area size of a set of anchor boxes to [s1,...,s n ], there are n different areas, set a set of anchor box width-height ratios [r1,...,r m ], there are m different aspect ratios, there are m·n combinations of the anchor box area size and the anchor box aspect ratio, the number of pixels in the image is w·h, and there are w·h·m·n anchor boxes; A3. Calculate the intersection-and-union ratio of the anchor frame and the Ground-Truth of the frame, and select several anchor frames whose intersection-and-union ratio exceeds the set threshold; including ; Set the threshold to 0.6, if the intersection ratio , then retain the anchor frame, if the intersection is , then the anchor box is discarded; if N anchor boxes are obtained that exceed the set threshold, the optimal feature T among the N anchor boxes is obtained i , i represents the number of video frames; A4. Use the network to extract features from the selected anchor frame to obtain N candidate template features Includes N candidate template features for: Among them, Φ(·) represents the trained framework; Represents the characteristics of the historical accumulation template; T i represents the optimal feature in the anchor box; Represents the Ground-Truth feature of the initial frame; i represents the number of frames in the video; GT represents the true value; S5. Evaluate the candidate template features through the trained image tracking model, calculate the Euclidean distance between the updated template and the Ground-Truth feature of the next frame, and sort the Euclidean distance; the evaluation includes a 5-layer convolutional neural network and a 3-layer fully connected layer; the 5-layer convolutional neural network includes the first convolution layer, the second convolution layer, the third convolution layer, the fourth convolution layer and the fifth convolution layer; the first convolution layer includes convolution layer 1 and maximum pooling layer 1; the second convolution layer includes convolution layer 2 and maximum pooling layer 2; the third convolution layer includes convolution Layer 3; the fourth convolution layer includes convolution layer 4; the fifth convolution layer includes convolution layer 5; the convolution kernel of convolution layer 1 is 11*11, and the skip shift is 2; the convolution kernel of maximum pooling layer 1 is 3*3, and the skip shift is 4; the convolution kernel of convolution layer 2 is 5*5; the convolution kernel of maximum pooling layer 2 is 3*3, and the skip shift is 2; the convolution kernel of convolution layer 3 is 3*3; the convolution kernel of convolution layer 4 is 3*3, and the convolution kernel of convolution layer 5 is 3*3; 3 fully connected layers include fully connected layer 1, discard layer 1, fully connected layer 2, discard layer 2, and fully connected layer 3; Calculate the Euclidean distance between the result and the Ground-Truth feature of the i+1th frame: Among them, ·2 represents the Euclidean distance between two values; Φ(·) represents the trained framework; Represents the characteristics of the historical accumulation template; T i represents the optimal feature in the anchor box; Represents the Ground-Truth feature of the initial frame; Represents the Ground-Truth feature of the i+1th frame; i represents the number of frames in the video; GT represents the true value; S6. Select the anchor frame with the smallest Euclidean distance and track the target selected in the current image.

2. The template updating method based on the twin network single target image tracker according to claim 1 is characterized in that In the step S1, the training data set includes the LaSOT data set.

3. The template updating method based on the twin network single target image tracker according to claim 2 is characterized in that In the step S2, an image tracking model is constructed using the AlexNet structure.