A lightweight LightDimp single target tracking method based on dimp tracker
By adopting the lightweight LightDimp method in the target tracking algorithm, using the MobileNet V3+ attention mechanism and related filters, combined with mask segmentation and IAO model compression, the device requirements of the target tracking algorithm in the existing technology on embedded devices are solved. High problem, achieving efficient target tracking and resource saving.
Patent Information
- Application Number
- CN202210562818.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-23
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-05-23
AI Technical Summary
When existing target tracking algorithms are run on mobile devices, due to the large amount of parameters and calculations, it is difficult to achieve a balance between accuracy and device requirements, making it difficult to transplant to embedded devices.
The lightweight LightDimp single target tracking method based on the dimp tracker is adopted, the lightweight network MobileNet V3+ attention mechanism GAM is used for feature extraction, and the relevant filter and Refine module are combined to generate accurate target frames through the scoring mechanism and mask segmentation. And reduce memory and CPU resource usage through IAO model compression.
It achieves the goal of reducing the amount of algorithm parameters and calculations while ensuring the accuracy of target tracking. It is suitable for the operation of embedded devices and solves the problem of high equipment demand.
Smart Images

Figure CN114882417B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and target tracking, and more specifically to a lightweight LightDimp single target tracking method based on a dimp tracker. Background Art
[0002] Moving target tracking belongs to the content of video analysis, and video analysis integrates the middle and high-level processing stages in the field of computer vision research, that is, processing image sequences to study the laws of moving targets, or provide semantic and non-semantic information support for the system's decision-making alarms, including motion detection, target classification, target tracking, behavior understanding, event detection, etc. As an important branch of the field of computer vision, the research and application of video target tracking methods are increasingly widely used in science and technology, national defense construction, aerospace, medicine and health, and various fields of the national economy. Therefore, the research on target tracking technology has great practical value and broad development prospects.
[0003] At present, target tracking technology has been widely used in many fields of life and work. The main applications are as follows: The rapid development of intelligent algorithms and mobile devices has enabled many functions to be embedded in mobile devices. In the existing target tracking algorithms, most of them have large parameters and large computational complexity, making it difficult to run on mobile devices. Therefore, it is necessary to design a new method to ensure the accuracy of target tracking while reducing the requirements for the device. Summary of the invention
[0004] In order to overcome the shortcomings of the prior art, the present invention provides a lightweight LightDimp single target tracking method based on a dimp tracker, which adopts a lightweight single target tracking network to overcome the high demand of the target tracking algorithm on the device, thereby solving the problem that the single target tracking algorithm is difficult to transplant to embedded devices.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A lightweight LightDimp single target tracking method based on a dimp tracker, the method comprising the following steps:
[0007] S1: Get the target detection frame coordinates and height and width information;
[0008] S2: Use the LightDimp algorithm to track the target. The process is as follows:
[0009] S 21 Feature extraction module: Use lightweight network MobileNet V3 + attention mechanism GAM;
[0010] S 22Correlation filtering module: multiple candidate regions are obtained through correlation filters, and then three possible regions are obtained through a scoring mechanism;
[0011] S 23 Refine module: In this module, there are two branches, bbox and mask. The bbox branch obtains the accurate target, and the mask branch generates the predicted mask. The results of the two branches are fused to generate the final accurate box.
[0012] S3: Output tracking process and target motion trajectory: The target motion trajectory is formed by extracting the center point of the target detection frame and splicing it, and the target motion trajectory is output.
[0013] Furthermore, in step S1, a target to be tracked is manually framed with a selection box in the first frame of video L, and the framed target, coordinate information (x, y) of the selection box, and height and width (h, w) information of the selection box are passed to step S2.
[0014] Furthermore, in step S2, the processing process of the feature extraction module is:
[0015] 2.1.1) Extract target template features: Use the lightweight network MobileNet V3 + attention mechanism GAM to extract the features of the target to be tracked in the first frame selection box, and adjust the extracted features through a 256x1x1 convolution kernel output;
[0016] 2.1.2) Extract the image features of the tracking frame: Use the same feature extraction method to extract the image features of the tracking frame;
[0017] 2.1.3) Input the features of the two images into the correlation filter module;
[0018] The processing process of the correlation filter module is as follows: the 256 channels feature information extracted by the feature extraction module is input into the filter, multiple possible targets are generated, and the similarity score is generated by comparing the feature similarity with the previous frame. last , select the three possible feature maps and selection box information with the highest scores, and output the generated 256*256 size feature map, selection box information and corresponding feature similarity score Score last ;
[0019] The processing process of the Refine module is as follows: In this module, there are two branches, bbox and mask. The bbox branch obtains a more accurate target selection frame through the convolution structure, and the feature similarity score is obtained by comparing it with the target information of the previous frame, which is recorded as Score. last , associate the target center with the target center of the previous frame, match the target trajectory using the Hungarian algorithm based on the position distance information, and calculate the distance score by Euclidean distancelocate , through Score first , Score last , Score locate The three scores are calculated to get the final score. The one with the highest score is the predicted target. In the mask branch, the prediction mask is generated by the U-Net network. The results of the two branches are fused through pixel-wise correlation to generate the final accurate box.
[0020] Furthermore, in step S3, the process of outputting the target motion trajectory is: extracting the center position of the predicted target selection box, connecting these center positions in series to form the target motion trajectory, and outputting the motion trajectory.
[0021] In the step S2, in the target tracking framework, the LightDimp algorithm, also called the LightDimp tracker, uses MobileNet V3 integrated with the GAM attention mechanism as the feature extraction network of the tracker, which can quickly extract more accurate features; generates possible areas through correlation filtering, and then uses the bbox to accurately locate the area and the mask segmentation mask to generate a more accurate target prediction selection box with less loss.
[0022] Preferably, a three-time scoring mechanism is used: the first time, the correlation filter is compared with the template features of the first frame to obtain three possible areas; the second time, the bbox branch of the Refine module is compared with the previous frame; the third time, the mask branch of the Refine module is compared with the target of the previous frame. The three comparisons are combined to integrate the feature information, distance information and shape information to obtain accurate results.
[0023] After the model training is completed, the IAO model compression method is used to compress the model. This solution can occupy less memory and CPU resources.
[0024] Compared with the prior art, the present invention has the following beneficial effects: by acquiring the object target detection frame, the present invention uses the LightDimp algorithm to track the target, obtains the object target motion trajectory, and automatically tracks the motion of the object target detection frame, thereby ensuring the accuracy of object target tracking while reducing the number of parameters and the amount of calculation of the algorithm, and ultimately reducing the high demand for equipment. The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Schematic diagram of application scenarios of the object target tracking method provided by this method;
[0026] Figure 2 A flowchart of the target tracking LightDimp method provided for this method;
[0027] Figure 3 This is a diagram of the visualization effect of the mask branch of the LightDimp algorithm;
[0028] Figure 4 Schematic diagram of the output of the target tracking method provided for this method. DETAILED DESCRIPTION
[0029] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0030] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making any creative work shall fall within the scope of protection of the present invention.
[0031] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprise" indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections. It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, the singular forms of "one", "an" and "the" are intended to include plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in the specification of the present invention and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0032] Reference Figure 1 to Figure 4 , a lightweight LightDimp single target tracking method based on a dimp tracker, the method comprising the following steps:
[0033] S1: Get the target detection frame coordinates and height and width information;
[0034] S2: Use the LightDimp algorithm to track the target. The process is as follows:
[0035] S 21 Feature extraction module: Use lightweight network MobileNet V3 + attention mechanism GAM;
[0036] S 22 Correlation filtering module: multiple candidate regions are obtained through correlation filters, and then three possible regions are obtained through a scoring mechanism;
[0037] S 23Refine module: In this module, there are two branches, bbox and mask. The bbox branch obtains the accurate target, and the mask branch generates the predicted mask. The results of the two branches are fused to generate the final accurate box.
[0038] S3: Output tracking process and target motion trajectory: The target motion trajectory is formed by extracting the center point of the target detection frame and splicing it, and the target motion trajectory is output.
[0039] Figure 1 Schematic diagram of application scenario of the object target tracking method provided by this method. Figure 2 A schematic flow chart of the object target tracking method provided by the present method. The object target tracking method is applied in an embedded device. The embedded device exchanges data with a camera, detects the target through the image acquired by the camera, and tracks the target using the LightDimp algorithm to determine the motion trajectory of the object target and then output it to the terminal device.
[0040] like Figure 2 As shown in the flowchart of the target tracking method, the method includes five modules in total: an input module, a feature extraction module, a correlation filter module, a Refine module, and an output module (corresponding to step S3).
[0041] The input module corresponding to step S1 performs data enhancement when training the model, which is beneficial to the learning of data with less training data. In the first frame of the input image, select the target to be tracked. Figure 1 As shown in the example application scenario, a candidate box is used to circle the target to be tracked.
[0042] In the feature extraction module, the lightweight network MobileNet V3 is used to extract the features of the selected target area. The LightDimp algorithm is improved on the DIMP tracker. The original tracker uses the ResNet network as the feature extraction network, but due to the large number of parameters and calculations, it is not suitable for lightweight methods. MobileNet V3 is more suitable as an efficient lightweight network.
[0043] In the correlation filtering module, the 256*256 size feature information extracted by the feature extraction module is input into the filter to generate multiple possible targets, and the similarity score is generated by comparing the feature similarity with the previous frame. last , select the three possible feature maps and selection box information with the highest scores, and output the generated 256*256 size feature map, selection box information and corresponding feature similarity score Score last Among them, the convolution layer with kernel_size of 7 and the PrRoI pooling layer are used.
[0044] In the Refine module, it is mainly divided into two branches: bbox branch and mask branch.
[0045] Bbox branch: Since the target is located near the center area, only two Conv-Bn-Hswish layers plus a pooling layer and a fully connected layer are needed to extract the target. The target center is associated with the target center of the previous frame, and the distance score is calculated by matching the Euclidean distance calculated by the Hungarian algorithm based on the position distance information. locate .
[0046] The target features are compared with the target template features of the first frame, and the feature similarity score is generated by the feature matching degree. first The feature similarity and distance information are combined to select the feature map with the highest score as the final prediction map for the next step of precise positioning using formula (1).
[0047] S=max(S1,S2,S3) (1)
[0048] Where S1 is obtained using formula (2), and the same is true for S2 and S3.
[0049] S1=θ1Score locate +θ2(Score last +Score first ) (2)
[0050] θ1, θ2 are proportional coefficients
[0051] Mask branch: The low-level features of the backbone network are integrated through FPN to restore the detail information to produce a high-quality mask. The mask head is implemented as a U-Net
[32] style decoder, which gradually upsamples the feature map and fuses it with the low-level features in the backbone until the resolution is the same as the input image, and predicts the mask from the last layer. Finally, the results of the two branches are fused through pixel-wise correlation to generate the final accurate box. The final loss is obtained by formula (3).
[0052] L=λ1L bbox +λ2L mask ,λ1=λ2=1000. (3)
[0053] The LightDimp algorithm uses a lightweight feature extraction network to reduce the number of network parameters and computation. By adding a two-step scoring and screening mechanism, a more accurate target can be obtained, and it is less likely to be offset. Adding a mask allows the network to incorporate the target's shape information, making the selection box more accurate.
[0054] The above is the tracking process of the LightDimp algorithm. During the model training process, an additional step of model compression is required: the IAO quantization scheme compresses the network model. After the model compression, the tracking model will occupy less memory and CPU resources, which is convenient for porting to embedded devices. In the compression scheme, quantization is divided into two steps. The first step is quantization reasoning: affine mapping from integer q to real number r: r = S (qZ), where the constant S is the scale factor and the constant Z is the shift.
[0055] Quantized convolution computation process during inference:
[0056] (1). Input quantized feature map lhs_quantized_val, uint8 type, offset lhs_zero_point, int32 type;
[0057] (2). Input quantized convolution kernel rhs_quantized_val, uint8 type, offset rhs_zero_point, int32 type;
[0058] (3). Convert unit8 to int32 type;
[0059] (4) For each convolution, calculate; int32_accumulator + = (lhs_quantized_val(i,j)-lhs_zero_point)*(rhs_quantized_val(j,k)-rhs_zero_point);
[0060] (5). Input the quantized multiplier quantized_multiplier, int32 type and the right shift times right_shift, int type;
[0061] (6) Calculate the multiplication quantized_multiplier*int32_accumulator and get the result of type int32;
[0062] (7). Shift left by right_shift to restore and get the result of int32;
[0063] (8). Finally, add the result offset result_zero_point, the order of 7 and 8;
[0064] (9). Limit the int32 type result to [0,255], and then force it to convert to uint8 type;
[0065] (10). Then dequantize to floating point numbers and update the statistical output value distribution information max, min;
[0066] Then quantize back to uint8;
[0067] (11). Then it goes through the quantization activation layer;
[0068] (12).Finally, dequantize to floating point numbers and output the network at this layer;
[0069] The second step is quantization training:
[0070] (1) Quantization range learning, quantizing the weights to int8 type, so that a 32-bit accumulator is not required;
[0071] (2) Fold the BN layer and fold the parameters of the BN layer into the previous convolutional or fully connected layer, thereby obtaining a network structure without a BN layer;
[0072] A lightweight target tracking model is obtained through the IAO quantization method.
[0073] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A lightweight LightDimp single target tracking method based on dimp tracker, characterized in that: The method comprises the following steps: S1: Get the target detection frame coordinates and height and width information; S2: Use the LightDimp algorithm to track the target. The process is as follows: S 21 Feature extraction module: Use lightweight network MobileNet V3 + attention mechanism GAM; S 22 Correlation filtering module: multiple candidate regions are obtained through correlation filters, and then three possible regions are obtained through a scoring mechanism; S 23 Refine module: In this module, there are two branches, bbox and mask. The bbox branch obtains the accurate target, and the mask branch generates the predicted mask. The results of the two branches are fused to generate the final accurate box. S3: Output tracking process and target motion trajectory: The target motion trajectory is formed by extracting the center point of the target detection frame and splicing it, and the target motion trajectory is output; In step S2, the processing process of the feature extraction module is: 2.1.1) Extract target template features: Use the lightweight network MobileNet V3 + attention mechanism GAM to extract the features of the target to be tracked in the first frame selection box, and adjust the extracted features through a 256x1x1 convolution kernel output; 2.1.2) Extract the image features of the tracking frame: Use the same feature extraction method to extract the image features of the tracking frame; 2.1.3) Input the features of the two images into the correlation filter module; The processing process of the correlation filter module is as follows: the 256 channels feature information extracted by the feature extraction module is input into the filter, multiple possible targets are generated, and the similarity score is generated by comparing the feature similarity with the previous frame. last , select the three possible feature maps and selection box information with the highest scores, and output the generated 256*256 size feature map, selection box information and corresponding feature similarity score Score last ; The processing process of the Refine module is as follows: In this module, there are two branches, bbox and mask. The bbox branch obtains a more accurate target selection frame through the convolution structure, and the feature similarity score is obtained by comparing it with the target information of the previous frame, which is recorded as Score. last , associate the target center with the target center of the previous frame, match the target trajectory using the Hungarian algorithm based on the position distance information, and calculate the distance score by Euclidean distance locate , through Score first , Score last , Score locate The three scores are calculated to get the final score. The one with the highest score is the predicted target. In the mask branch, the prediction mask is generated by the U-Net network. The results of the two branches are fused through pixel-wise correlation to generate the final accurate box.
2. The lightweight LightDimp single target tracking method based on the dimp tracker as described in claim 1 is characterized in that in the step S1, a selection box is manually used to frame the target to be tracked in the first frame of the video L, and the framed target, the coordinate information (x, y) of the selection box and the height and width (h, w) of the selection box are passed into step S2.
3. The lightweight LightDimp single target tracking method based on the dimp tracker according to claim 1 or 2, characterized in that: In step S3, the process of outputting the target motion trajectory is: extracting the center position of the predicted target selection box, connecting these center positions in series to form the target motion trajectory, and outputting the motion trajectory.
4. The lightweight LightDimp single target tracking method based on the dimp tracker according to claim 1, characterized in that: In step S2, in the target tracking framework, the LightDimp algorithm, also called the LightDimp tracker, uses the MobileNet V3 integrated with the GAM attention mechanism as the feature extraction network of the tracker, which can quickly extract more accurate features; The possible area is generated through correlation filtering, and then the bbox is used to accurately locate the area and the mask is used to segment the mask to generate a more accurate target prediction box with less loss.
5. The lightweight LightDimp single target tracking method based on the dimp tracker according to claim 4, characterized in that: Three-time scoring mechanism: the first time, the correlation filter is compared with the template features of the first frame to obtain three possible areas; the second time, the bbox branch of the Refine module is compared with the previous frame; the third time, the mask branch of the Refine module is compared with the target of the previous frame. The three comparisons are combined to integrate the feature information, distance information and shape information to obtain accurate results.
6. The lightweight LightDimp single target tracking method based on the dimp tracker according to claim 1 or 2, characterized in that: After the model training is completed, the IAO model compression method is used to compress the model.
Citation Information
Patent Citations
Multi-target tracking method and system suitable for embedded terminal
CN113034548A
Online updating target tracking method and system based on twinborn attention network
CN113643329A
Deep apparent features and adaptive aggregation network-based multi-face tracking method
WO2020155873A1
